Created
October 6, 2015 12:38
-
-
Save rowanoulton/7665bb3acb1e065ff0ca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# spec/model/fruit_spec.rb | |
RSpec.describe Fruit, elasticsearch: true, :type => :model do | |
it 'should be indexed' do | |
# create an instance of your model | |
Fruit.create(name: 'apple') | |
# refresh the index | |
Fruit.__elasticsearch__.refresh_index! | |
# verify your model was indexed | |
expect(Fruit.search('apple').records.length).to eq(1) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment