I have the ultrasphinx plugin installed and it is working fine, but I’d
like to write some tests for it.
I have tried putting this test in one of my unit tests:
@results = Ultrasphinx::Search.new(:query => “Second”).run.results
assert_equal @results.first.headline, “Second Story”
With a fixture properly defined for the model being searched… but the
test errors out.
The error I’m getting is:
NoMethodError: You have a nil object when you didn’t expect it!
The error occurred while evaluating nil.headline (so, the results set
comes back as empty).
Anyway, I’m wondering if there is any weirdness to how I have to set up
test/unit to make it work.
the daemon IS running… If I try the same search in a console, it
doesn’t run there either (in the test environment - script/console
test). But, the results set does come back in development
Do I need config/ultrasphinx/test.conf ? I have development.conf in
there, but I’m not sure how to generate test.conf?