I see the problem being in this statement:
the data is loaded and then rolled back in a transaction during a typical cucumber test so there is no way for thinking_sphinx to index it
It may not be fast to have thinking_sphinx index the results, but it's certainly possible within the transaction. Since it's a single integration test, and not done for each of your (many) unit tests, I'd take the speed hit.
So now you need to figure out how to trigger that re-index during a transaction.
# somewhere in /features/support:
before('@reindexing') do
require 'Rake'
class MyModel
after_save :force_reindex!
def force_reindex!
# in case multiple runs of this block cause the hook
# to get added multiple times, let's check to make sure
# we haven't already reindexed for this save
return if @__reindexed
Rake["thinking_sphinx:rebuild"].execute
@__reindexed = true
end
end
end
after('@reindexing') do
class MyModel
def force_reindex!
# do nothing; the hook still gets called, but that's ok
end
end
end
In /features/integration.feature
(or whatever), you'd have
@reindexing
Feature: The whole shebang, altogether
Scenario: ...