Browse Source

test: pass in log and user in housing provider opts test for support user

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

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

@ -61,9 +61,9 @@ RSpec.describe Form::Lettings::Questions::StockOwner, type: :model do
end
context "when user support" do
before do
question.current_user = create(:user, :support)
end
let!(:user) { create(:user, :support) }
let!(:log) { create(:lettings_log) }
let(:expected_opts) do
Organisation.all.each_with_object(options) do |organisation, hsh|
@ -73,7 +73,7 @@ RSpec.describe Form::Lettings::Questions::StockOwner, type: :model do
end
it "shows all orgs" do
expect(question.answer_options).to eq(expected_opts)
expect(question.displayed_answer_options(log, user)).to eq(expected_opts)
end
end
end

Loading…
Cancel
Save