From e2a2153c93f66dbad64d8986d07d8e431cba241d Mon Sep 17 00:00:00 2001 From: Robin Houston Date: Wed, 25 Jan 2012 22:18:52 +0000 Subject: Make the load-sample-data script actually work --- script/load-sample-data | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'script/load-sample-data') diff --git a/script/load-sample-data b/script/load-sample-data index 0521ef849..84b8a28eb 100755 --- a/script/load-sample-data +++ b/script/load-sample-data @@ -6,7 +6,15 @@ LOC=`dirname $0` rake --silent spec:db:fixtures:load -"$LOC/runner" 'puts File.expand_path(File.dirname(__FILE__) + "/spec/spec_helper"); require File.expand_path(File.dirname(__FILE__) + "/spec/spec_helper"); RawEmail.all().each {|email| email.data = load_file_fixture("useless_raw_email.email")}' +"$LOC/runner" /dev/stdin < Date: Sun, 29 Jan 2012 16:26:50 +0000 Subject: Load all raw emails for testing Previously there was just one raw email, and the test code relied on that fact. Generalise it to handle multiple raw emails. This change causes a number of tests to fail, because it exposes failures that should have happened when the second raw email was added but were masked by the fact that the text of this second raw email was never loaded. These failures will be fixed in the next commit. --- script/load-sample-data | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'script/load-sample-data') diff --git a/script/load-sample-data b/script/load-sample-data index 84b8a28eb..92846ce17 100755 --- a/script/load-sample-data +++ b/script/load-sample-data @@ -4,17 +4,16 @@ # the fact that the fixtures aren't aware of the fact that RawEmails # have a filesystem representation of their contents -LOC=`dirname $0` +LOC=`dirname "$0"` + rake --silent spec:db:fixtures:load + "$LOC/runner" /dev/stdin < Date: Mon, 30 Jan 2012 09:00:03 +0000 Subject: Prompt users to reindex xapian after loading sample data --- script/load-sample-data | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'script/load-sample-data') diff --git a/script/load-sample-data b/script/load-sample-data index 92846ce17..e5f1be4cd 100755 --- a/script/load-sample-data +++ b/script/load-sample-data @@ -16,4 +16,4 @@ ENV["RAILS_ENV"] = env # so restore to what it was before load_raw_emails_data END -echo "Loaded fixtures." +echo "Loaded fixtures. You may now wish to run $LOC/update-xapian-index" -- cgit v1.2.3