diff --git a/spec/models/form/sales/pages/organisation_spec.rb b/spec/models/form/sales/pages/organisation_spec.rb index 73f5ab2c7..710edbecc 100644 --- a/spec/models/form/sales/pages/organisation_spec.rb +++ b/spec/models/form/sales/pages/organisation_spec.rb @@ -81,7 +81,7 @@ RSpec.describe Form::Sales::Pages::Organisation, type: :model do :organisation_relationship, child_organisation: user.organisation, parent_organisation: stock_owner, - ) + ) end it "is not shown" do @@ -102,12 +102,12 @@ RSpec.describe Form::Sales::Pages::Organisation, type: :model do :organisation_relationship, child_organisation: user.organisation, parent_organisation: stock_owner1, - ) + ) create( :organisation_relationship, child_organisation: user.organisation, parent_organisation: stock_owner2, - ) + ) end it "is not shown" do diff --git a/spec/models/form/sales/questions/owning_organisation_id_spec.rb b/spec/models/form/sales/questions/owning_organisation_id_spec.rb index b005838ba..815a42319 100644 --- a/spec/models/form/sales/questions/owning_organisation_id_spec.rb +++ b/spec/models/form/sales/questions/owning_organisation_id_spec.rb @@ -3,7 +3,7 @@ require "rails_helper" RSpec.describe Form::Sales::Questions::OwningOrganisationId, type: :model do subject(:question) { described_class.new(question_id, question_definition, page) } - let(:user) { FactoryBot.create(:user, :data_coordinator)} + let(:user) { FactoryBot.create(:user, :data_coordinator) } let(:question_id) { nil } let(:question_definition) { nil } let(:page) { instance_double(Form::Page) } @@ -112,6 +112,7 @@ RSpec.describe Form::Sales::Questions::OwningOrganisationId, type: :model do end end end + context "when user is support" do let(:user) { create(:user, :support) }