mirror of
https://github.com/CodeforLeipzig/stadtratmonitor.git
synced 2024-12-22 23:53:15 +01:00
Initial feature spec for search page
This commit is contained in:
parent
463d01f44f
commit
6dd6387b39
2 changed files with 21 additions and 1 deletions
|
@ -18,7 +18,7 @@ div
|
||||||
- else
|
- else
|
||||||
| #{@papers.total} Dokumente in der Datenbank
|
| #{@papers.total} Dokumente in der Datenbank
|
||||||
div
|
div
|
||||||
ul.no-bullet
|
ul.no-bullet#search_results
|
||||||
- @papers.each do |doc|
|
- @papers.each do |doc|
|
||||||
li.search-result
|
li.search-result
|
||||||
small = doc.paper_type
|
small = doc.paper_type
|
||||||
|
|
20
spec/features/basic_search_spec.rb
Normal file
20
spec/features/basic_search_spec.rb
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.feature "Basic search", type: :feature, elasticsearch: true do
|
||||||
|
scenario "It displays the search form" do
|
||||||
|
visit search_path body: "leipzig"
|
||||||
|
expect(page).to have_content("Stadtratmonitor")
|
||||||
|
expect(page).to have_field("paper_search_query")
|
||||||
|
expect(page).to have_select("Typ")
|
||||||
|
expect(page).to have_select("Einreicher")
|
||||||
|
expect(page).to have_selector("label", text: "Sortierung")
|
||||||
|
expect(page).to have_field("paper_search_sort_by_date", type: "radio")
|
||||||
|
expect(page).to have_field("paper_search_sort_by_score", type: "radio")
|
||||||
|
end
|
||||||
|
|
||||||
|
scenario "It displays the search results" do
|
||||||
|
visit search_path body: "leipzig"
|
||||||
|
expect(page).to have_selector("ul#search_results")
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
Loading…
Reference in a new issue