ankane/searchkick — pull request #15 by mehulkar (2013-08-15 01:15:03+00:00)
Title: Reindexing

We're using fixtures in our Rspec tests that are autoloaded before the specs run. It would be nice to be able to add the following in our `spec_helper.rb` to reindex fixtures in the test environment before specs run.

```ruby
require 'rake'
MyApp::Application.load_tasks

Rspec.configure do |config|
config.before :all do
Rake::Task['searchkick:reindex:all'].invoke
end
end
```

The only thing I'm not 100% sure about is if multiple indices will be created if we run `Model.reindex` multiple times.