From e9c35bad82e2329e65bc8a074a312ec0cb37b451 Mon Sep 17 00:00:00 2001 From: Sam Seed Date: Wed, 7 Dec 2022 12:35:04 +0000 Subject: [PATCH] refactor: change owning_organisation_id: organisation.id to owning_organisation: organisation --- spec/models/scheme_spec.rb | 2 +- spec/requests/schemes_controller_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/models/scheme_spec.rb b/spec/models/scheme_spec.rb index 8b4b4b6f2..f59fe56c5 100644 --- a/spec/models/scheme_spec.rb +++ b/spec/models/scheme_spec.rb @@ -217,7 +217,7 @@ RSpec.describe Scheme, type: :model do context "when the owning organisation is set as a non-stock-owning organisation" do it "throws the correct validation error" do - expect { scheme.update!({ owning_organisation_id: non_stock_owning_org.id }) }.to raise_error(ActiveRecord::RecordInvalid, /Enter an organisation that owns housing stock/) + expect { scheme.update!({ owning_organisation: non_stock_owning_org }) }.to raise_error(ActiveRecord::RecordInvalid, /Enter an organisation that owns housing stock/) end end end diff --git a/spec/requests/schemes_controller_spec.rb b/spec/requests/schemes_controller_spec.rb index 49ba22321..7eca070b0 100644 --- a/spec/requests/schemes_controller_spec.rb +++ b/spec/requests/schemes_controller_spec.rb @@ -494,7 +494,7 @@ RSpec.describe SchemesController, type: :request do let(:organisation) { FactoryBot.create(:organisation) } let(:params) do { scheme: { - owning_organisation_id: organisation.id, + owning_organisation: organisation, } } end