#59 √ rejected
Derek P.

Cucumber testing and Solr_Rails

Reported by Derek P. | December 9th, 2009 @ 04:42 AM | in Feature Requests

How can I get this to integrate with my cucumber tests? At the moment, I am getting the following error, just trying to run my existing tests.

Connection refused - connect(2) (Errno::ECONNREFUSED)

I would love to be able to test this, but I think its a requirement that my existing tests can still run as they were.

Thanks!

Comments and changes to this ticket

  • Derek P.

    Derek P. December 9th, 2009 @ 05:03 AM

    Here is my hack to make it run my tests successfully

    hack to make sunspot run near with my tests

    Sunspot::Rails::Server.start
    at_exit do
    Sunspot::Rails::Server.stop end

    I am not sure if this is a good idea or not, I've got it running in an isolated environment, so its indexes are kept to itself. Could we get a real solution to this?

  • Loren

    Loren January 13th, 2010 @ 03:18 AM

    Derek where in your Cucumber features/steps are you putting this start/stop code?

  • Derek P.

    Derek P. January 13th, 2010 @ 04:52 AM

    I was putting it in env.rb, I believe. I ended up just making a rake task that invokes the sunspot:start, runs tests, then invokes sunspot:stop

    this has been working fine for me, its sort of a hack, but at least it can be done.

  • mat

    mat January 26th, 2010 @ 02:42 PM

    • → State changed from “new” to “invalid”

    Solr is an external service - you wouldn't expect hook code that starts up your MySQL database before running specs, would you?

    That said, if that's what you're looking for in your project, I'd consider using a global before(:each) and after(:each) to do that. Calling Sunspot::Rails::Server.start / stop is the right idea.

  • mat

    mat January 26th, 2010 @ 02:42 PM

    • → State changed from “invalid” to “rejected”

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Awesome Solr interaction for Ruby

People watching this ticket

You can update this ticket by sending an email to from your email client. (help)