diff options
| author | Luc Donnet | 2015-01-05 14:56:12 +0100 |
|---|---|---|
| committer | Luc Donnet | 2015-01-05 14:56:12 +0100 |
| commit | 3bc6d313bebdc1f03e4021aabbc774a0cd97d938 (patch) | |
| tree | ac5b8c6d8309012136606d9fd9b9a00290f486a8 /spec/features/stop_areas_spec.rb | |
| parent | e632a4634b1762f4c73d11f1e5b127de9832a1ff (diff) | |
| download | chouette-core-3bc6d313bebdc1f03e4021aabbc774a0cd97d938.tar.bz2 | |
Initialize rails 4 migration
Diffstat (limited to 'spec/features/stop_areas_spec.rb')
| -rw-r--r-- | spec/features/stop_areas_spec.rb | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/spec/features/stop_areas_spec.rb b/spec/features/stop_areas_spec.rb new file mode 100644 index 000000000..4d1b7e2bb --- /dev/null +++ b/spec/features/stop_areas_spec.rb @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +require 'spec_helper' + +describe "StopAreas", :type => :feature do + login_user + + let!(:stop_areas) { Array.new(2) { Factory(:stop_area) } } + subject { stop_areas.first } + + describe "list" do + it "display stop_areas" do + visit referential_stop_areas_path(referential) + expect(page).to have_content(stop_areas.first.name) + expect(page).to 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}" + expect(page).to have_content(stop_areas.first.name) + end + + it "display map" do + visit referential_stop_areas_path(referential) + click_link "#{stop_areas.first.name}" + expect(page).to 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") + expect(page).to 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") + expect(page).to have_content("StopArea Modified") + end + end + +end |
