diff options
| author | cedricnjanga | 2018-01-30 23:07:07 -0800 |
|---|---|---|
| committer | cedricnjanga | 2018-01-30 23:07:07 -0800 |
| commit | 4023ea52097a47458ac2fcad36d343aba0c8e68b (patch) | |
| tree | e891b85392aa911bb43d1b0ef73f526226b18216 /spec | |
| parent | 7ec19d8dc153e1491cb1a693b11b3b0a351f316c (diff) | |
| download | chouette-core-4023ea52097a47458ac2fcad36d343aba0c8e68b.tar.bz2 | |
Make some changes to avoid unnacessaty lines of code
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/factories/calendars.rb | 1 | ||||
| -rw-r--r-- | spec/features/calendars_permissions_spec.rb | 7 |
2 files changed, 5 insertions, 3 deletions
diff --git a/spec/factories/calendars.rb b/spec/factories/calendars.rb index 5f3188bee..d9fd242d1 100644 --- a/spec/factories/calendars.rb +++ b/spec/factories/calendars.rb @@ -6,6 +6,7 @@ FactoryGirl.define do sequence(:dates) { |n| [ Date.yesterday - n, Date.yesterday - 2*n ] } shared false organisation + workgroup end sequence :date_range do |n| diff --git a/spec/features/calendars_permissions_spec.rb b/spec/features/calendars_permissions_spec.rb index 9b47ab2bb..4857592d5 100644 --- a/spec/features/calendars_permissions_spec.rb +++ b/spec/features/calendars_permissions_spec.rb @@ -2,6 +2,7 @@ RSpec.describe 'Calendars', type: :feature do login_user let(:calendar) { create :calendar, organisation_id: 1 } + let(:workgroup) { calendar.workgroup } describe 'permissions' do before do @@ -13,7 +14,7 @@ RSpec.describe 'Calendars', type: :feature do end context 'on show view' do - let( :path ){ calendar_path(calendar) } + let( :path ){ workgroup_calendar_path(workgroup, calendar) } context 'if present → ' do let( :permission ){ true } @@ -33,7 +34,7 @@ RSpec.describe 'Calendars', type: :feature do end context 'on edit view' do - let( :path ){ edit_calendar_path(calendar) } + let( :path ){ edit_workgroup_calendar_path(workgroup, calendar) } context 'if present → ' do let( :permission ){ true } @@ -51,7 +52,7 @@ RSpec.describe 'Calendars', type: :feature do end context 'on index view' do - let( :path ){ calendars_path } + let( :path ){ workgroup_calendars_path(workgroup) } context 'if present → ' do let( :permission ){ true } |
