From ceb3d54095756161180b2017b1152a5767db96d0 Mon Sep 17 00:00:00 2001 From: Jack S Date: Wed, 23 Nov 2022 09:56:10 +0000 Subject: [PATCH] Never show created_by_id in CYA --- .../form/lettings/questions/created_by_id.rb | 4 ++-- .../lettings/questions/created_by_id_spec.rb | 16 ++-------------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/app/models/form/lettings/questions/created_by_id.rb b/app/models/form/lettings/questions/created_by_id.rb index a120e72a8..d5921e935 100644 --- a/app/models/form/lettings/questions/created_by_id.rb +++ b/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? diff --git a/spec/models/form/lettings/questions/created_by_id_spec.rb b/spec/models/form/lettings/questions/created_by_id_spec.rb index 04fac20fb..a5e60ad2b 100644 --- a/spec/models/form/lettings/questions/created_by_id_spec.rb +++ b/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