diff options
-rw-r--r-- | spec/lib/acts_as_xapian_spec.rb | 28 | ||||
-rw-r--r-- | spec/models/info_request_spec.rb | 1 |
2 files changed, 18 insertions, 11 deletions
diff --git a/spec/lib/acts_as_xapian_spec.rb b/spec/lib/acts_as_xapian_spec.rb index d411bf856..1d9256441 100644 --- a/spec/lib/acts_as_xapian_spec.rb +++ b/spec/lib/acts_as_xapian_spec.rb @@ -3,13 +3,19 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe ActsAsXapian::Search do - before :all do - # make sure an index exists - ActsAsXapian.update_index - end - describe "#words_to_highlight" do + before :all do + # make sure an index exists + @alice = FactoryGirl.create(:public_body, :name => 'alice') + ActsAsXapian.update_index + end + + after :all do + @alice.destroy + ActsAsXapian.update_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", "word"] @@ -80,6 +86,12 @@ describe ActsAsXapian::Search do ActsAsXapian.update_index end + after :all do + @alice.destroy + @bob.destroy + ActsAsXapian.update_index + end + it 'returns a UTF-8 encoded string' do s = ActsAsXapian::Search.new([PublicBody], "alece", :limit => 100) s.spelling_correction.should == "alice" @@ -93,12 +105,6 @@ describe ActsAsXapian::Search do s.spelling_correction.should == "bôbby" end - after :all do - @alice.destroy - @bob.destroy - ActsAsXapian.update_index - end - end end
\ No newline at end of file diff --git a/spec/models/info_request_spec.rb b/spec/models/info_request_spec.rb index 70947584b..9d1e02442 100644 --- a/spec/models/info_request_spec.rb +++ b/spec/models/info_request_spec.rb @@ -1221,6 +1221,7 @@ describe InfoRequest do describe InfoRequest, "when constructing a list of requests by query" do before(:each) do + load_raw_emails_data get_fixtures_xapian_index end |