|
|
|
@ -40,10 +40,6 @@ RSpec.describe Form::Lettings::Pages::ManagingOrganisation, type: :model do
|
|
|
|
|
it "is not shown" do |
|
|
|
|
expect(page.routed_to?(log, nil)).to eq(false) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "does not update managing_organisation_id" do |
|
|
|
|
expect { page.routed_to?(log, nil) }.not_to change(log.reload, :managing_organisation) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "when support" do |
|
|
|
@ -56,10 +52,6 @@ RSpec.describe Form::Lettings::Pages::ManagingOrganisation, type: :model do
|
|
|
|
|
it "is shown" do |
|
|
|
|
expect(page.routed_to?(log, user)).to eq(true) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "does not update managing_organisation_id" do |
|
|
|
|
expect { page.routed_to?(log, user) }.not_to change(log.reload, :managing_organisation) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "when owning_organisation not set" do |
|
|
|
@ -69,10 +61,6 @@ RSpec.describe Form::Lettings::Pages::ManagingOrganisation, type: :model do
|
|
|
|
|
it "is not shown" do |
|
|
|
|
expect(page.routed_to?(log, user)).to eq(false) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "does not update managing_organisation_id" do |
|
|
|
|
expect { page.routed_to?(log, user) }.not_to change(log.reload, :managing_organisation) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "when holds own stock" do |
|
|
|
@ -84,10 +72,6 @@ RSpec.describe Form::Lettings::Pages::ManagingOrganisation, type: :model do
|
|
|
|
|
it "is not shown" do |
|
|
|
|
expect(page.routed_to?(log, user)).to eq(false) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "does not update managing_organisation_id" do |
|
|
|
|
expect { page.routed_to?(log, user) }.not_to change(log.reload, :managing_organisation) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "with >1 managing_agents" do |
|
|
|
@ -99,10 +83,6 @@ RSpec.describe Form::Lettings::Pages::ManagingOrganisation, type: :model do
|
|
|
|
|
it "is shown" do |
|
|
|
|
expect(page.routed_to?(log, user)).to eq(true) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "does not update managing_organisation_id" do |
|
|
|
|
expect { page.routed_to?(log, user) }.not_to change(log.reload, :managing_organisation) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "with 1 managing_agents" do |
|
|
|
@ -120,10 +100,6 @@ RSpec.describe Form::Lettings::Pages::ManagingOrganisation, type: :model do
|
|
|
|
|
it "is not shown" do |
|
|
|
|
expect(page.routed_to?(log, user)).to eq(false) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "updates managing_organisation_id" do |
|
|
|
|
expect { page.routed_to?(log, user) }.to change(log.reload, :managing_organisation).to(managing_agent) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
@ -137,10 +113,6 @@ RSpec.describe Form::Lettings::Pages::ManagingOrganisation, type: :model do
|
|
|
|
|
it "is shown" do |
|
|
|
|
expect(page.routed_to?(log, user)).to eq(true) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "does not update managing_organisation_id" do |
|
|
|
|
expect { page.routed_to?(log, user) }.not_to change(log.reload, :managing_organisation) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "when holds own stock" do |
|
|
|
@ -152,10 +124,6 @@ RSpec.describe Form::Lettings::Pages::ManagingOrganisation, type: :model do
|
|
|
|
|
it "is not shown" do |
|
|
|
|
expect(page.routed_to?(log, user)).to eq(false) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "does not update managing_organisation_id" do |
|
|
|
|
expect { page.routed_to?(log, user) }.not_to change(log.reload, :managing_organisation) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "with >1 managing_agents" do |
|
|
|
@ -167,10 +135,6 @@ RSpec.describe Form::Lettings::Pages::ManagingOrganisation, type: :model do
|
|
|
|
|
it "is shown" do |
|
|
|
|
expect(page.routed_to?(log, user)).to eq(true) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "does not update managing_organisation_id" do |
|
|
|
|
expect { page.routed_to?(log, user) }.not_to change(log.reload, :managing_organisation) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "with 1 managing_agents" do |
|
|
|
@ -188,10 +152,6 @@ RSpec.describe Form::Lettings::Pages::ManagingOrganisation, type: :model do
|
|
|
|
|
it "is not shown" do |
|
|
|
|
expect(page.routed_to?(log, user)).to eq(false) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "updates managing_organisation_id" do |
|
|
|
|
expect { page.routed_to?(log, user) }.to change(log.reload, :managing_organisation).to(managing_agent) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|