diff options
| author | Zakaria BOUZIANE | 2015-02-10 15:05:46 +0100 | 
|---|---|---|
| committer | Zakaria BOUZIANE | 2015-02-10 15:05:46 +0100 | 
| commit | dc399e49058e112ac58019fd472c6ce629a5fab3 (patch) | |
| tree | b7dacc3906fb5ed93480033ef7d63a4d957372d9 /spec/features/routes_spec.rb | |
| parent | 33486970d275348717ef429e81018b5051609d34 (diff) | |
| download | chouette-core-dc399e49058e112ac58019fd472c6ce629a5fab3.tar.bz2 | |
Boarding / alighting problem fix and spec
Diffstat (limited to 'spec/features/routes_spec.rb')
| -rw-r--r-- | spec/features/routes_spec.rb | 37 | 
1 files changed, 34 insertions, 3 deletions
| 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 | 
