connection rejected from solr in Rspec

后端 未结 4 992
情深已故
情深已故 2021-02-14 21:03

I use the sunspot-rails for search. These is a Rspec looks like:

describe \"GET search\" do
  before(:all) do
    system(\"rake\", \"sunspot:solr:start\")
  end
         


        
4条回答
  •  醉酒成梦
    2021-02-14 21:50

    I got this working just by adding

    `rake sunspot:solr:start RAILS_ENV=test`
    

    to spec_helper.rb

    Edit: I ended up going with https://github.com/collectiveidea/sunspot_test like Simmo mentioned. It was re-running the rake task on every test run for some reason (even though I had it in the prefork block of spork). Not sure why, but the sunspot_test gem seems like the way to go for now.

提交回复
热议问题