Add more search controller specs

This commit is contained in:
Lars Henrik Mai 2016-02-17 21:20:17 +01:00
parent 8890354909
commit 85167bc563

View file

@ -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