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