mirror of
https://github.com/CodeforLeipzig/stadtratmonitor.git
synced 2024-12-22 23:53:15 +01:00
Initial search filter spec
This commit is contained in:
parent
27f02fd9fa
commit
871c05dc11
1 changed files with 18 additions and 0 deletions
18
spec/features/search_filters_spec.rb
Normal file
18
spec/features/search_filters_spec.rb
Normal 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
|
Loading…
Reference in a new issue