Initial search filter spec

This commit is contained in:
Lars Henrik Mai 2016-03-08 08:59:23 +01:00
parent 27f02fd9fa
commit 871c05dc11

View file

@ -0,0 +1,18 @@
require 'rails_helper'
RSpec.feature "Search filters", type: :feature, elasticsearch: true do
scenario "Filtering by paper type", js: true do
paper_types = %w(Antrag Anfrage Beschlussvorlage)
papers = paper_types.map do |t|
FactoryGirl.create(:paper, paper_type: t)
end
Paper.__elasticsearch__.refresh_index!
visit search_path body: "leipzig"
expect(page).to have_css("li.search-result", count: 3)
select "Antrag (1)", from: "Typ"
expect(page).to have_css("li.search-result", count: 1)
end
end