diff options
| -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      ) | 
