diff options
| author | Vlatka Pavisic | 2017-02-06 11:42:12 +0100 |
|---|---|---|
| committer | Vlatka Pavisic | 2017-02-07 11:25:29 +0100 |
| commit | d94b1271d147fdb5bbd1e616e116173198e858db (patch) | |
| tree | e1b5631e72e009ffd80fdf4e47159b2b11cd899e /spec/features/routes_spec.rb | |
| parent | 9c3095c20aaef122212ed71ce8818e3a18b13308 (diff) | |
| download | chouette-core-d94b1271d147fdb5bbd1e616e116173198e858db.tar.bz2 | |
Refs #2476 : Disable modification and deletion of resources from another referential; in progress
Diffstat (limited to 'spec/features/routes_spec.rb')
| -rw-r--r-- | spec/features/routes_spec.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/spec/features/routes_spec.rb b/spec/features/routes_spec.rb index e82987811..7f1917862 100644 --- a/spec/features/routes_spec.rb +++ b/spec/features/routes_spec.rb @@ -4,13 +4,15 @@ require 'spec_helper' describe "Routes", :type => :feature do login_user - let!(:line) { create(: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) } } let!(:journey_pattern) { create(:journey_pattern, route: route) } + before { @user.update(organisation: referential.organisation) } + describe "from lines page to a line page" do it "display line's routes" do visit referential_lines_path(referential) @@ -22,7 +24,7 @@ describe "Routes", :type => :feature do describe "from line's page to route's page" do it "display route properties" do - visit referential_line_path(referential,line) + visit referential_line_path(referential, line) click_link "#{route.name}" expect(page).to have_content(route.name) expect(page).to have_content(route.number) @@ -31,7 +33,7 @@ describe "Routes", :type => :feature do describe "from line's page, create a new route" do it "return to line's page that display new route" do - visit referential_line_path(referential,line) + visit referential_line_path(referential, line) click_link "Ajouter un itinéraire" fill_in "route_name", :with => "A to B" # select 'Aller', :from => "route_direction" @@ -110,6 +112,12 @@ describe "Routes", :type => :feature do end end + context 'user belongs to another organisation' do + xit 'does not show link to a create route page' do + expect(page).not_to have_content(I18n.t('routes.actions.new')) + end + end + context 'user does not have permission to create routes' do it 'does not show link to a create route page' do @user.update_attribute(:permissions, []) |
