Browse Source

CLDC-1863: Test updated

pull/1748/head
Aaron Spencer 3 years ago
parent
commit
17a9319342
  1. 6
      spec/models/form/lettings/questions/stock_owner_spec.rb

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

@ -107,15 +107,17 @@ RSpec.describe Form::Lettings::Questions::StockOwner, type: :model do
let(:log) { create(:lettings_log) } let(:log) { create(:lettings_log) }
let(:non_stock_organisation) { create(:organisation, holds_own_stock: false) }
let(:expected_opts) do let(:expected_opts) do
Organisation.all.each_with_object(options) do |organisation, hsh| Organisation.where(holds_own_stock: true).each_with_object(options) do |organisation, hsh|
hsh[organisation.id] = organisation.name hsh[organisation.id] = organisation.name
hsh hsh
end end
end end
it "shows all orgs" do it "shows orgs where organisation holds own stock" do
expect(question.displayed_answer_options(log, user)).to eq(expected_opts) expect(question.displayed_answer_options(log, user)).to eq(expected_opts)
expect(question.displayed_answer_options(log, user)).not_to include(non_stock_organisation.id)
end end
end end
end end

Loading…
Cancel
Save