Browse files

fixing a spelling error, rewriting a brittle spec

  • Loading branch information...
1 parent 203925c commit 6fac67a6e916dfea5d6fcf8dc3788314bb9f22c8 @aaw aaw committed Jan 27, 2012
Showing with 6 additions and 22 deletions.
  1. +3 −0 .gitignore
  2. +1 −1 lib/mongoid_fulltext.rb
  3. +2 −21 spec/mongoid/fulltext_spec.rb
View
3 .gitignore
@@ -14,6 +14,9 @@ doc
# jeweler generated
pkg
+# RVM
+.rvmrc
+
# Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
#
# * Create a file at ~/.gitignore
View
2 lib/mongoid_fulltext.rb
@@ -86,7 +86,7 @@ def fulltext_search_ensure_indexes(index_name, config)
next if !keys.member?('ngram')
all_filter_keys |= keys.find_all{ |key| key.starts_with?('filter_values.') }
if keys & correct_keys != correct_keys
- Mongoid.logger.info "Droping #{name} [#{keys & correct_keys} <=> #{correct_keys}]" if Mongoid.logger
+ Mongoid.logger.info "Dropping #{name} [#{keys & correct_keys} <=> #{correct_keys}]" if Mongoid.logger
coll.drop_index(name)
end
end
View
23 spec/mongoid/fulltext_spec.rb
@@ -640,27 +640,8 @@ module Mongoid
# but mongo will automatically attempt to index _id in the background
Mongoid.master["mongoid_fulltext.index_basicartwork_0"].index_information.size.should <= 1
BasicArtwork.create_indexes
- Mongoid.master["mongoid_fulltext.index_basicartwork_0"].index_information.should ==
- {
- "_id_" => {
- "name" => "_id_",
- "ns" => "mongoid_fulltext_test.mongoid_fulltext.index_basicartwork_0",
- "key" => { "_id" => 1 },
- "v" => 1
- },
- "fts_index" => {
- "name" => "fts_index",
- "ns" => "mongoid_fulltext_test.mongoid_fulltext.index_basicartwork_0",
- "key" => { "ngram" => 1, "score" => -1 },
- "v" => 1
- },
- "document_id_1" => {
- "name" => "document_id_1",
- "ns" => "mongoid_fulltext_test.mongoid_fulltext.index_basicartwork_0",
- "key" => { "document_id" => 1 },
- "v"=> 1
- }
- }
+ expected_indexes = ['_id_', 'fts_index', 'document_id_1'].sort
+ Mongoid.master["mongoid_fulltext.index_basicartwork_0"].index_information.keys.sort.should == expected_indexes
end
it "doesn't fail on models that don't have a fulltext index" do

0 comments on commit 6fac67a

Please sign in to comment.