diff --git a/spec/controllers/search_controller_spec.rb b/spec/controllers/search_controller_spec.rb index f04c3e0..26241ce 100644 --- a/spec/controllers/search_controller_spec.rb +++ b/spec/controllers/search_controller_spec.rb @@ -7,6 +7,18 @@ RSpec.describe SearchController, type: :controller, elasticsearch: true do get :index, body: 'leipzig' expect(response).to have_http_status(:success) end + + it "assigns @search_definition with default sort order" do + search = PaperSearch.new(sort_by: 'score') + get :index, body: 'leipzig' + expect(assigns(:search_definition).attributes).to eq(search.attributes) + end + + it "renders the index template" do + get :index, body: 'leipzig' + expect(response).to render_template(:index) + end + end end