aboutsummaryrefslogtreecommitdiffstats
path: root/spec/features/stop_areas_spec.rb
diff options
context:
space:
mode:
authorvlatka pavisic2016-12-02 15:10:55 +0100
committervlatka pavisic2016-12-02 15:11:48 +0100
commit47572dc97aa526dc702d7456bb7459786eb1eb0e (patch)
tree5fd79dc1ca3085bd813db37819e45e753e470c66 /spec/features/stop_areas_spec.rb
parent2a92002b6e4a6a54af85f8144e25944043eefb0f (diff)
downloadchouette-core-47572dc97aa526dc702d7456bb7459786eb1eb0e.tar.bz2
Refs #2133 : Feature specs for referential companies, lines... and search
Diffstat (limited to 'spec/features/stop_areas_spec.rb')
-rw-r--r--spec/features/stop_areas_spec.rb27
1 files changed, 21 insertions, 6 deletions
diff --git a/spec/features/stop_areas_spec.rb b/spec/features/stop_areas_spec.rb
index 3dbb7b658..a1ec37a0a 100644
--- a/spec/features/stop_areas_spec.rb
+++ b/spec/features/stop_areas_spec.rb
@@ -8,18 +8,33 @@ describe "StopAreas", :type => :feature do
let!(:stop_areas) { Array.new(2) { create :stop_area, stop_area_referential: stop_area_referential } }
subject { stop_areas.first }
- describe "list" do
- it "display stop_areas" do
- visit stop_area_referential_stop_areas_path(stop_area_referential)
+ describe "index" do
+ before(:each) { visit stop_area_referential_stop_areas_path(stop_area_referential) }
+
+ it "displays stop_areas" do
expect(page).to have_content(stop_areas.first.name)
expect(page).to have_content(stop_areas.last.name)
end
+
+ context 'fitering' do
+ it 'supports filtering by name' do
+ fill_in 'q[name_or_objectid_cont]', with: stop_areas.first.name
+ 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 filtering by objectid' do
+ fill_in 'q[name_or_objectid_cont]', with: stop_areas.first.objectid
+ click_button 'search-btn'
+ expect(page).to have_content(stop_areas.first.name)
+ expect(page).not_to have_content(stop_areas.last.name)
+ end
+ end
end
describe "show" do
- it "display stop_area" do
- visit stop_area_referential_stop_areas_path(stop_area_referential)
- # click_link "#{stop_areas.first.name}"
+ it "displays stop_area" do
visit stop_area_referential_stop_area_path(stop_area_referential, stop_areas.first)
expect(page).to have_content(stop_areas.first.name)
end