From 2d85da354b9842684ec69a78fdee735d0947dd91 Mon Sep 17 00:00:00 2001 From: Lars Henrik Mai Date: Thu, 18 Feb 2016 07:15:28 +0100 Subject: [PATCH] Failing controller test for search result --- spec/controllers/search_controller_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/controllers/search_controller_spec.rb b/spec/controllers/search_controller_spec.rb index 26241ce..402c976 100644 --- a/spec/controllers/search_controller_spec.rb +++ b/spec/controllers/search_controller_spec.rb @@ -19,6 +19,14 @@ RSpec.describe SearchController, type: :controller, elasticsearch: true do expect(response).to render_template(:index) end + it "executes the search with PaperSearch parameters" do + result_page = double("page", results: []) # MEH + response = double("es_response", page: result_page) + expect(Paper).to receive(:search).and_return(response) + + get :index, body: 'leipzig' + end + end end