From 871c05dc114673721b12b4af289cfb67ed3d7768 Mon Sep 17 00:00:00 2001 From: Lars Henrik Mai Date: Tue, 8 Mar 2016 08:59:23 +0100 Subject: [PATCH] Initial search filter spec --- spec/features/search_filters_spec.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 spec/features/search_filters_spec.rb diff --git a/spec/features/search_filters_spec.rb b/spec/features/search_filters_spec.rb new file mode 100644 index 0000000..17ef9fc --- /dev/null +++ b/spec/features/search_filters_spec.rb @@ -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