How can I write a request spec with Capybara/RSpec for testing Sunspot/Solr searching? <p>I'd like to write my usual RSpec/Capybara request specs to test search functionality using Sunspot and Solr. I've been digging around but can't find how to get this working. I have the sunspot_test gem installed and have verified that the Products created do exist. The issue seems to be with the indexing, maybe? What am I missing?</p> <pre><code>require 'spec_helper' describe "search" do context "when searching by name/description" do let!(:super_mario_bros_3) { Factory(:product, :name =&gt; 'Super Mario Bros. 3') } let!(:legend_of_zelda) { Factory(:product, :name =&gt; 'Legend of Zelda') } before { Product.reindex; Sunspot.commit } it "should only find games matching the search text", :js =&gt; true, :search =&gt; true do # search_for fills in and submits the search form search_for("Super") # This yields an empty array p Product.search { keyword "super" }.results # These fail page.should have_content super_mario_bros_3.name page.should have_no_content legend_of_zelda.name end end end </code></pre>