connection rejected from solr in Rspec

后端 未结 4 1075
情深已故
情深已故 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:58

    This is a wild-ass guess, but I bet you have a Solr server configured in your config/environments/development.rb file to look locally on a given port, but no such configuration in your config/environments/test.rb

    This is causing it to connect to the default address/port where you do not in fact have a Solr server running when you execute your tests.

    I don't know enough about the Solr client in Ruby to be sure of this, but since no one else has weighed in yet I hope this points you in the right direction.

提交回复
热议问题