I have an integral test that runs using selenium. In mine, in front of each I build several objects and an index with solr. I can see activity in my subnsspot solr test log. And then in my test, I search and get an error message because my sunspot solr server is not working. This is because it works with RAILS_ENV = test.
Here are mine before each:
before :each do Sunspot.remove_all!(Residential) Sunspot.commit @prop1 = FactoryGirl.create(:residential, { subdivision: "Steiner Ranch", street_name: "propone" }) @prop1.index! @prop2 = FactoryGirl.create(:residential, { subdivision: "Jester Estates", street_name: "proptwo" }) @prop2.index! @prop3 = FactoryGirl.create(:residential, { subdivision: "Cypress Ranch", street_name: "propthree" }) @prop3.index! end
And here is my test:
it "single word", :js => true do visit '/' fill_in 'subdivision', :with => 'cypress' page.should_not have_content('propone') page.should_not have_content('proptwo') page.should have_content('propthree') end
Any idea why the search is done in a development environment and not in a test environment? I have an ENV ["RAILS_ENV"] || = 'test' as the first line in my spec_helper.
source share