Browse Source

refactor: linting

pull/957/head
natdeanlewissoftwire 3 years ago
parent
commit
f695cc1508
  1. 20
      spec/requests/organisation_relationships_controller_spec.rb

20
spec/requests/organisation_relationships_controller_spec.rb

@ -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

Loading…
Cancel
Save