diff options
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/features/journey_pattern_spec.rb | 22 | ||||
| -rw-r--r-- | spec/features/routes_spec.rb | 37 |
2 files changed, 45 insertions, 14 deletions
diff --git a/spec/features/journey_pattern_spec.rb b/spec/features/journey_pattern_spec.rb index 9bddcf3bc..470d74a99 100644 --- a/spec/features/journey_pattern_spec.rb +++ b/spec/features/journey_pattern_spec.rb @@ -11,7 +11,7 @@ describe "JourneyPatterns", :type => :feature do describe "from routes page to a journey_pattern page" do it "display route's journey_patterns" do visit referential_line_route_path(referential,line,route) - click_link "Liste des missions" + click_link I18n.t('routes.show.journey_patterns') expect(page).to have_content(journey_pattern.name) end end @@ -19,8 +19,8 @@ describe "JourneyPatterns", :type => :feature do describe "from route's page to journey_pattern's page" do it "display journey_pattern properties" do visit referential_line_route_path(referential,line,route) - click_link "Liste des missions" - click_link "#{journey_pattern.name}" + click_link I18n.t('routes.show.journey_patterns') + click_link journey_pattern.name expect(page).to have_content(journey_pattern.published_name) expect(page).to have_content(journey_pattern.comment) expect(page).to have_content(journey_pattern.registration_number) @@ -30,10 +30,10 @@ describe "JourneyPatterns", :type => :feature do describe "from route's page, create a new journey_pattern" do it "return to route's page that display new journey_pattern" do visit referential_line_route_path(referential,line,route) - click_link "Ajouter une mission" - fill_in "Nom", :with => "A to B" - fill_in "Comment", :with => "AB" - click_button("Créer mission") + click_link I18n.t("journey_patterns.actions.new") + fill_in "journey_pattern[name]", :with => "A to B" + fill_in "journey_pattern[comment]", :with => "AB" + click_button(I18n.t('formtastic.create',model: I18n.t('activerecord.models.journey_pattern.one'))) expect(page).to have_content("A to B") end end @@ -41,10 +41,10 @@ describe "JourneyPatterns", :type => :feature do describe "from route's page, select a journey_pattern and delete it" do it "return to route's page without journey_pattern name" do visit referential_line_route_path(referential,line,route) - click_link "Liste des missions" - click_link "#{journey_pattern.name}" - click_link "Supprimer cette mission" - click_link "Liste des missions" + click_link I18n.t('routes.show.journey_patterns') + click_link journey_pattern.name + click_link I18n.t('journey_patterns.actions.destroy') + click_link I18n.t('routes.show.journey_patterns') expect(page).not_to have_content(journey_pattern.name) end end diff --git a/spec/features/routes_spec.rb b/spec/features/routes_spec.rb index 538c6a969..f512e6a83 100644 --- a/spec/features/routes_spec.rb +++ b/spec/features/routes_spec.rb @@ -4,9 +4,12 @@ require 'spec_helper' describe "Routes", :type => :feature do login_user - let!(:line) { Factory(:line) } - let!(:route) { Factory(:route, :line => line) } - let!(:route2) { Factory(:route, :line => line) } + let!(:line) { create(:line) } + let!(:route) { create(:route, :line => line) } + let!(:route2) { create(:route, :line => line) } + #let!(:stop_areas) { Array.new(4) { create(:stop_area) } } + let!(:stop_points) { Array.new(4) { create(:stop_point, :route => route) } } + describe "from lines page to a line page" do it "display line's routes" do @@ -58,4 +61,32 @@ describe "Routes", :type => :feature do expect(page).not_to have_content(route.name) end end + + describe "from route's page, select edit boarding/alighting and update it" do + it "Edits boarding/alighting properties on route stops" do + visit referential_line_route_path(referential, line, route) + click_link I18n.t('routes.actions.edit_boarding_alighting') + expect(page).to have_content(I18n.t('routes.edit_boarding_alighting.title')) + stop_points.each do |sp| + expect(page).to have_content(sp.stop_area.name) + expect(page).to have_content(sp.for_boarding) + expect(page).to have_content(sp.for_alighting) + end + end + end + + describe "Modifies boarding/alighting properties on route stops" do + it "Puts (http) an update request" do + #visit edit_boarding_alighting_referential_line_route_path(referential, line, route) + visit referential_line_route_path(referential, line, route) + click_link I18n.t('routes.actions.edit_boarding_alighting') + #select('', :from => '') + # Changes the boarding of the first stop + # Changes the alighting of the last stop + # save + #click_button(I18n.t('helpers.submit.update', model: I18n.t('activerecord.models.route.one'))) + click_button(I18n.t('helpers.submit.update', model: I18n.t('activerecord.models.route.one'))) + end + end + end |
