aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorAlban Peignier2018-03-15 10:17:57 +0100
committerGitHub2018-03-15 10:17:57 +0100
commitec7b83ebc22ea7355d49c4b4fac32ef3104a9622 (patch)
tree5fb93f87993eacdbac52ac57325a79066ae7b171 /spec
parent9e1ad7402881a0ef47b949a3ad95ba39e6e65008 (diff)
parent3036b52aea082c12dec82d463936dae29643cb22 (diff)
downloadchouette-core-ec7b83ebc22ea7355d49c4b4fac32ef3104a9622.tar.bz2
Merge pull request #365 from af83/6033-stop-area-states
Enable stop area states. Refs #6033
Diffstat (limited to 'spec')
-rw-r--r--spec/features/stop_areas_spec.rb40
1 files changed, 40 insertions, 0 deletions
diff --git a/spec/features/stop_areas_spec.rb b/spec/features/stop_areas_spec.rb
index 668eb2fa3..02e853999 100644
--- a/spec/features/stop_areas_spec.rb
+++ b/spec/features/stop_areas_spec.rb
@@ -30,6 +30,46 @@ describe "StopAreas", :type => :feature do
expect(page).to have_content(stop_areas.first.name)
expect(page).not_to have_content(stop_areas.last.name)
end
+
+ context 'filtering by status' do
+ before do
+ stop_areas.first.activate!
+ stop_areas.last.deactivate!
+ end
+
+ describe 'updated stop areas in before block' do
+
+ it 'supports displaying only stop areas in creation' do
+ find("#q_status_in_creation").set(true)
+ click_button 'search-btn'
+ expect(page).not_to have_content(stop_areas.first.name)
+ expect(page).not_to have_content(stop_areas.last.name)
+ end
+
+ it 'supports displaying only confirmed stop areas' do
+ find("#q_status_confirmed").set(true)
+ click_button 'search-btn'
+ expect(page).to have_content(stop_areas.first.name)
+ expect(page).not_to have_content(stop_areas.last.name)
+ end
+
+ it 'supports displaying only deactivated stop areas' do
+ find("#q_status_deactivated").set(true)
+ click_button 'search-btn'
+ expect(page).not_to have_content(stop_areas.first.name)
+ expect(page).to have_content(stop_areas.last.name)
+ end
+
+ it 'should display all stop areas if all filters are checked' do
+ find("#q_status_in_creation").set(true)
+ find("#q_status_confirmed").set(true)
+ find("#q_status_deactivated").set(true)
+ click_button 'search-btn'
+ expect(page).to have_content(stop_areas.first.name)
+ expect(page).to have_content(stop_areas.last.name)
+ end
+ end
+ end
end
end