spec/spec_helper.rb in locomotivecms-search-0.0.5 vs spec/spec_helper.rb in locomotivecms-search-0.1.0

- old
+ new

@@ -33,15 +33,15 @@ config.order = "random" config.include FactoryGirl::Syntax::Methods config.before(:each) do - Mongoid.master.collections.select { |c| c.name != 'system.indexes' }.each(&:drop) + Mongoid.purge! end config.after(:each) do - Mongoid.master.collections.select { |c| c.name != 'system.indexes' }.each(&:drop) + Mongoid.purge! end end shared_examples "a search backend" do it "that works" do @@ -58,7 +58,21 @@ visit 'http://test.example.com' fill_in "Search", with: "not found" click_on "Search" page.should_not have_content "Page not found" + end + + it "that is able to index modified content types" do + @ctype.entries_custom_fields.last.searchable = true + @ctype.save + visit 'http://test.example.com' + fill_in "Search", with: "stuff" + click_on "Search" + page.should_not have_content "Findable entry" + Locomotive::Search::ContentTypeReindexer.new.perform(@ctype.id) + visit 'http://test.example.com' + fill_in "Search", with: "stuff" + click_on "Search" + page.should have_content "Findable entry" end end \ No newline at end of file