diff --git a/spec/controllers/search_controller_spec.rb b/spec/controllers/search_controller_spec.rb index fbcbd18..f04c3e0 100644 --- a/spec/controllers/search_controller_spec.rb +++ b/spec/controllers/search_controller_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.describe SearchController, type: :controller do +RSpec.describe SearchController, type: :controller, elasticsearch: true do describe "GET #index" do it "returns http success" do diff --git a/spec/support/elasticsearch.rb b/spec/support/elasticsearch.rb new file mode 100644 index 0000000..4575c58 --- /dev/null +++ b/spec/support/elasticsearch.rb @@ -0,0 +1,5 @@ +RSpec.configure do |config| + config.before :each, elasticsearch: true do + Paper.__elasticsearch__.create_index!(force: true) + end +end