Browse Source

Never show created_by_id in CYA

CLDC-20-more-ac-fixes3
Jack S 2 years ago
parent
commit
ceb3d54095
  1. 4
      app/models/form/lettings/questions/created_by_id.rb
  2. 16
      spec/models/form/lettings/questions/created_by_id_spec.rb

4
app/models/form/lettings/questions/created_by_id.rb

@ -35,8 +35,8 @@ class Form::Lettings::Questions::CreatedById < ::Form::Question
answer_options[value]
end
def hidden_in_check_answers?(_log, current_user)
!current_user.support?
def hidden_in_check_answers?(_log, _current_user)
true
end
def derived?

16
spec/models/form/lettings/questions/created_by_id_spec.rb

@ -51,20 +51,8 @@ RSpec.describe Form::Lettings::Questions::CreatedById, type: :model do
expect(question.derived?).to be true
end
context "when the current user is support" do
let(:support_user) { build(:user, :support) }
it "is shown in check answers" do
expect(question.hidden_in_check_answers?(nil, support_user)).to be false
end
end
context "when the current user is not support" do
let(:user) { build(:user) }
it "is not shown in check answers" do
expect(question.hidden_in_check_answers?(nil, user)).to be true
end
it "is not shown in check answers" do
expect(question.hidden_in_check_answers?(nil, user_1)).to be true
end
context "when the owning organisation is already set" do

Loading…
Cancel
Save