|
|
@ -192,19 +192,17 @@ RSpec.describe OrganisationRelationshipsController, type: :request do |
|
|
|
|
|
|
|
|
|
|
|
describe "organisation_relationships#delete_housing_provider" do |
|
|
|
describe "organisation_relationships#delete_housing_provider" do |
|
|
|
let!(:housing_provider) { FactoryBot.create(:organisation) } |
|
|
|
let!(:housing_provider) { FactoryBot.create(:organisation) } |
|
|
|
|
|
|
|
|
|
|
|
before do |
|
|
|
|
|
|
|
FactoryBot.create(:organisation_relationship, :owning, child_organisation: organisation, parent_organisation: housing_provider) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let(:params) do |
|
|
|
let(:params) do |
|
|
|
{ |
|
|
|
{ |
|
|
|
"organisation_to_remove_id": housing_provider.id, |
|
|
|
"organisation_to_remove_id": housing_provider.id, |
|
|
|
} |
|
|
|
} |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
let(:request) { delete "/organisations/#{organisation.id}/housing-providers", headers:, params: } |
|
|
|
let(:request) { delete "/organisations/#{organisation.id}/housing-providers", headers:, params: } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
before do |
|
|
|
|
|
|
|
FactoryBot.create(:organisation_relationship, :owning, child_organisation: organisation, parent_organisation: housing_provider) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "deletes the new organisation relationship" do |
|
|
|
it "deletes the new organisation relationship" do |
|
|
|
expect { request }.to change(OrganisationRelationship, :count).by(-1) |
|
|
|
expect { request }.to change(OrganisationRelationship, :count).by(-1) |
|
|
|
end |
|
|
|
end |
|
|
@ -396,19 +394,17 @@ RSpec.describe OrganisationRelationshipsController, type: :request do |
|
|
|
|
|
|
|
|
|
|
|
describe "organisation_relationships#delete_housing_provider" do |
|
|
|
describe "organisation_relationships#delete_housing_provider" do |
|
|
|
let!(:housing_provider) { FactoryBot.create(:organisation) } |
|
|
|
let!(:housing_provider) { FactoryBot.create(:organisation) } |
|
|
|
|
|
|
|
|
|
|
|
before do |
|
|
|
|
|
|
|
FactoryBot.create(:organisation_relationship, :owning, child_organisation: organisation, parent_organisation: housing_provider) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let(:params) do |
|
|
|
let(:params) do |
|
|
|
{ |
|
|
|
{ |
|
|
|
"organisation_to_remove_id": housing_provider.id, |
|
|
|
"organisation_to_remove_id": housing_provider.id, |
|
|
|
} |
|
|
|
} |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
let(:request) { delete "/organisations/#{organisation.id}/housing-providers", headers:, params: } |
|
|
|
let(:request) { delete "/organisations/#{organisation.id}/housing-providers", headers:, params: } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
before do |
|
|
|
|
|
|
|
FactoryBot.create(:organisation_relationship, :owning, child_organisation: organisation, parent_organisation: housing_provider) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "deletes the new organisation relationship" do |
|
|
|
it "deletes the new organisation relationship" do |
|
|
|
expect { request }.to change(OrganisationRelationship, :count).by(-1) |
|
|
|
expect { request }.to change(OrganisationRelationship, :count).by(-1) |
|
|
|
end |
|
|
|
end |
|
|
|