diff options
| author | Luc Donnet | 2018-03-30 10:22:26 +0200 |
|---|---|---|
| committer | Luc Donnet | 2018-03-30 10:22:26 +0200 |
| commit | ddf9807fd2e5e0ec26011051f63fda87c6c1f2f6 (patch) | |
| tree | 212d224aad9481acf538ecd2794a04f04204323d | |
| parent | afbe88e752f3c5e7eadfcf1ab53c740b60334779 (diff) | |
| download | chouette-core-ddf9807fd2e5e0ec26011051f63fda87c6c1f2f6.tar.bz2 | |
Fix spec/features/calendars_permissions_spec.rb to use correct Workgroup Refs #6258 @1
| -rw-r--r-- | spec/features/calendars_permissions_spec.rb | 4 | ||||
| -rw-r--r-- | spec/support/referential.rb | 12 |
2 files changed, 14 insertions, 2 deletions
diff --git a/spec/features/calendars_permissions_spec.rb b/spec/features/calendars_permissions_spec.rb index 4857592d5..656c0dd78 100644 --- a/spec/features/calendars_permissions_spec.rb +++ b/spec/features/calendars_permissions_spec.rb @@ -1,8 +1,8 @@ RSpec.describe 'Calendars', type: :feature do login_user - let(:calendar) { create :calendar, organisation_id: 1 } - let(:workgroup) { calendar.workgroup } + let(:calendar) { create :calendar, organisation: first_organisation, workgroup: first_workgroup } + let(:workgroup) { first_workgroup } describe 'permissions' do before do diff --git a/spec/support/referential.rb b/spec/support/referential.rb index 9acdce73a..b50844ae4 100644 --- a/spec/support/referential.rb +++ b/spec/support/referential.rb @@ -8,6 +8,10 @@ module ReferentialHelper Organisation.find_by!(code: "first") end + def first_workgroup + Workgroup.find_by_name('IDFM') + end + def self.included(base) base.class_eval do extend ClassMethods @@ -53,10 +57,18 @@ RSpec.configure do |config| referential.add_member organisation, owner: true end + workgroup = FactoryGirl.create( + :workgroup, + name: "IDFM", + line_referential: line_referential, + stop_area_referential: stop_area_referential + ) + workbench = FactoryGirl.create( :workbench, name: "Gestion de l'offre", organisation: organisation, + workgroup: workgroup, line_referential: line_referential, stop_area_referential: stop_area_referential ) |
