diff options
| author | Luc Donnet | 2012-04-26 14:31:09 +0200 |
|---|---|---|
| committer | Luc Donnet | 2012-04-26 14:31:09 +0200 |
| commit | 856016f8fa214c9f924d68019aaa96c6589aa1c8 (patch) | |
| tree | 32ffab6405a727882f35e2345556b712368658e0 /spec | |
| parent | 283c635d1547ae012a1aca0fd02329bb203c240f (diff) | |
| download | chouette-core-856016f8fa214c9f924d68019aaa96c6589aa1c8.tar.bz2 | |
Add links between stop areas
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/requests/stop_areas_spec.rb | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/spec/requests/stop_areas_spec.rb b/spec/requests/stop_areas_spec.rb new file mode 100644 index 000000000..bd01c59ba --- /dev/null +++ b/spec/requests/stop_areas_spec.rb @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +require 'spec_helper' + +describe "StopAreas" do + login_user + + let!(:referential) { create(:referential).switch } + let!(:stop_areas) { referential; Array.new(2) { Factory(:stop_area) } } + subject { stop_areas.first } + + describe "list" do + it "display stop_areas" do + visit referential_stop_areas_path(referential) + page.should have_content(stop_areas.first.name) + page.should have_content(stop_areas.last.name) + end + + end + + + describe "show" do + it "display stop_area" do + visit referential_stop_areas_path(referential) + click_link "#{stop_areas.first.name}" + page.should have_content(stop_areas.first.name) + end + + it "display map" do + visit referential_stop_areas_path(referential) + click_link "#{stop_areas.first.name}" + page.should have_selector("#map", :class => 'stop_area') + end + + end + + describe "new" do + it "creates stop_area and return to show" do + visit referential_stop_areas_path(referential) + click_link "Ajouter un arrêt" + fill_in "Nom", :with => "StopArea 1" + fill_in "Numéro d'enregistrement", :with => "test-1" + #fill_in "Identifiant Neptune", :with => "test:StopArea:1" + click_button("Créer Arrêt") + page.should have_content("StopArea 1") + end + end + + describe "edit and return to show" do + it "edit stop_area" do + visit referential_stop_area_path(referential, subject) + click_link "Modifier cet arrêt" + fill_in "Nom", :with => "StopArea Modified" + fill_in "Numéro d'enregistrement", :with => "test-1" + click_button("Modifier Arrêt") + page.should have_content("StopArea Modified") + end + end + +end |
