aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/info_request_spec.rb1
-rw-r--r--spec/models/public_body_spec.rb2
-rw-r--r--spec/models/xapian_spec.rb5
3 files changed, 7 insertions, 1 deletions
diff --git a/spec/models/info_request_spec.rb b/spec/models/info_request_spec.rb
index 0ba8abd75..c9ee57c74 100644
--- a/spec/models/info_request_spec.rb
+++ b/spec/models/info_request_spec.rb
@@ -156,6 +156,7 @@ describe InfoRequest do
end
it "should cope with indexing after item is deleted" do
+ load_raw_emails_data
IncomingMessage.find(:all).each{|x| x.parse_raw_email!}
rebuild_xapian_index
# delete event from underneath indexing; shouldn't cause error
diff --git a/spec/models/public_body_spec.rb b/spec/models/public_body_spec.rb
index bc693b4da..34a91a2c9 100644
--- a/spec/models/public_body_spec.rb
+++ b/spec/models/public_body_spec.rb
@@ -464,7 +464,7 @@ end
describe PublicBody, " when override all public body request emails set" do
it "should return the overridden request email" do
- MySociety::Config.should_receive(:get).with("OVERRIDE_ALL_PUBLIC_BODY_REQUEST_EMAILS", "").twice.and_return("catch_all_test_email@foo.com")
+ AlaveteliConfiguration.should_receive(:override_all_public_body_request_emails).twice.and_return("catch_all_test_email@foo.com")
@geraldine = public_bodies(:geraldine_public_body)
@geraldine.request_email.should == "catch_all_test_email@foo.com"
end
diff --git a/spec/models/xapian_spec.rb b/spec/models/xapian_spec.rb
index c40334142..7aab9cdc6 100644
--- a/spec/models/xapian_spec.rb
+++ b/spec/models/xapian_spec.rb
@@ -373,6 +373,11 @@ end
# I would expect ActsAsXapian to have some tests under vendor/plugins/acts_as_xapian, but
# it looks like this is not the case. Putting a test here instead.
describe ActsAsXapian::Search, "#words_to_highlight" do
+ before(:each) do
+ load_raw_emails_data
+ get_fixtures_xapian_index
+ end
+
it "should return a list of words used in the search" do
s = ActsAsXapian::Search.new([PublicBody], "albatross words", :limit => 100)
s.words_to_highlight.should == ["albatross", "words"]