diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2011-07-29 10:02:57 +0100 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2011-07-29 10:10:52 +0100 |
commit | 7573586c3be6318e19ae02ff008dfb2a576b5980 (patch) | |
tree | df84452dada69c64ebe0c09d51a994b9715fd67f /spec/models/xapian_spec.rb | |
parent | 51a74f4b275fab25ac567843ab99b885a8444789 (diff) |
To make tests pass with RawEmails on the filesystem, instead of hacky dependency on existence of text_binary field in raw_emails model, rewrite tests (and their fixtures) to explicitly load data from FS when raw_emails are used.
Diffstat (limited to 'spec/models/xapian_spec.rb')
-rw-r--r-- | spec/models/xapian_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/models/xapian_spec.rb b/spec/models/xapian_spec.rb index 79ffc4839..37e68b145 100644 --- a/spec/models/xapian_spec.rb +++ b/spec/models/xapian_spec.rb @@ -35,6 +35,9 @@ end describe PublicBody, " when indexing public bodies with Xapian" do fixtures :public_bodies, :public_body_translations, :incoming_messages, :outgoing_messages, :raw_emails, :comments + before(:each) do + load_raw_emails_data(raw_emails) + end it "should search index the main name field" do rebuild_xapian_index @@ -126,6 +129,9 @@ end describe User, " when indexing requests by user they are from" do fixtures :users, :info_request_events, :info_requests, :incoming_messages, :outgoing_messages, :raw_emails, :comments + before(:each) do + load_raw_emails_data(raw_emails) + end it "should find requests from the user" do rebuild_xapian_index @@ -210,6 +216,9 @@ end describe User, " when indexing comments by user they are by" do fixtures :users, :info_request_events, :info_requests, :comments, :incoming_messages, :outgoing_messages, :raw_emails, :comments + before(:each) do + load_raw_emails_data(raw_emails) + end it "should find requests from the user" do rebuild_xapian_index @@ -244,6 +253,9 @@ end describe InfoRequest, " when indexing requests by their title" do fixtures :info_request_events, :info_requests, :incoming_messages, :raw_emails, :comments + before(:each) do + load_raw_emails_data(raw_emails) + end it "should find events for the request" do rebuild_xapian_index @@ -272,6 +284,9 @@ end describe InfoRequest, " when indexing requests by tag" do fixtures :info_request_events, :info_requests, :incoming_messages, :raw_emails, :comments + before(:each) do + load_raw_emails_data(raw_emails) + end it "should find request by tag, even when changes" do rebuild_xapian_index @@ -291,6 +306,9 @@ end describe PublicBody, " when indexing authorities by tag" do fixtures :public_bodies, :public_body_translations, :incoming_messages, :outgoing_messages, :raw_emails, :comments + before(:each) do + load_raw_emails_data(raw_emails) + end it "should find request by tag, even when changes" do rebuild_xapian_index |