Browse Source

lint

fix-remove-attr-accessors-from-questions-in-cldc-1723
Sam Seed 2 years ago
parent
commit
2e32567a8b
  1. 2
      spec/models/form/lettings/questions/managing_organisation_spec.rb
  2. 7
      spec/models/form/lettings/questions/stock_owner_spec.rb

2
spec/models/form/lettings/questions/managing_organisation_spec.rb

@ -117,7 +117,7 @@ RSpec.describe Form::Lettings::Questions::ManagingOrganisation, type: :model do
context "when the owning-managing organisation relationship is deleted" do context "when the owning-managing organisation relationship is deleted" do
let(:user) { create(:user, :support) } let(:user) { create(:user, :support) }
let(:owning_org) { create(:organisation, name: "Owning org", holds_own_stock: true) } let(:owning_org) { create(:organisation, name: "Owning org", holds_own_stock: true) }
let(:managing_org) { create(:organisation, name: "Managing org", holds_own_stock: false) } let(:managing_org) { create(:organisation, name: "Managing org", holds_own_stock: false) }
let!(:org_rel) { create(:organisation_relationship, parent_organisation: owning_org, child_organisation: managing_org) } let!(:org_rel) { create(:organisation_relationship, parent_organisation: owning_org, child_organisation: managing_org) }

7
spec/models/form/lettings/questions/stock_owner_spec.rb

@ -56,7 +56,7 @@ RSpec.describe Form::Lettings::Questions::StockOwner, type: :model do
"" => "Select an option", "" => "Select an option",
owning_org_1.id => "Owning org 1", owning_org_1.id => "Owning org 1",
user.organisation.id => "User org (Your organisation)", user.organisation.id => "User org (Your organisation)",
owning_org_2.id => "Owning org 2" owning_org_2.id => "Owning org 2",
} }
end end
@ -70,9 +70,10 @@ RSpec.describe Form::Lettings::Questions::StockOwner, type: :model do
{ {
"" => "Select an option", "" => "Select an option",
user.organisation.id => "User org (Your organisation)", user.organisation.id => "User org (Your organisation)",
owning_org_2.id => "Owning org 2" owning_org_2.id => "Owning org 2",
} }
end end
it "doesn't remove the housing provider from the list of allowed housing providers" do it "doesn't remove the housing provider from the list of allowed housing providers" do
log.update!(owning_organisation: owning_org_2) log.update!(owning_organisation: owning_org_2)
expect(question.displayed_answer_options(log, user)).to eq(options) expect(question.displayed_answer_options(log, user)).to eq(options)
@ -87,7 +88,7 @@ RSpec.describe Form::Lettings::Questions::StockOwner, type: :model do
{ {
"" => "Select an option", "" => "Select an option",
owning_org_1.id => "Owning org 1", owning_org_1.id => "Owning org 1",
owning_org_2.id => "Owning org 2" owning_org_2.id => "Owning org 2",
} }
end end

Loading…
Cancel
Save