From 9d1ab75015f8694ebbd4230b77b312fdfc37dcd2 Mon Sep 17 00:00:00 2001 From: Lars Henrik Mai Date: Wed, 17 Feb 2016 20:46:03 +0100 Subject: [PATCH] Configure rspec for elasticsearch --- spec/controllers/search_controller_spec.rb | 2 +- spec/support/elasticsearch.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 spec/support/elasticsearch.rb 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