diff --git a/app/models/form/lettings/questions/managing_organisation.rb b/app/models/form/lettings/questions/managing_organisation.rb index c7d56aeb6..82ae2aabd 100644 --- a/app/models/form/lettings/questions/managing_organisation.rb +++ b/app/models/form/lettings/questions/managing_organisation.rb @@ -47,11 +47,7 @@ class Form::Lettings::Questions::ManagingOrganisation < ::Form::Question def hidden_in_check_answers?(_log, user = nil) @current_user = user - - return false unless @current_user - return false if @current_user.support? - - managing_organisations_answer_options.count < 2 + @current_user.nil? end def enabled diff --git a/spec/models/form/lettings/questions/managing_organisation_spec.rb b/spec/models/form/lettings/questions/managing_organisation_spec.rb index 997fc8285..5b356257d 100644 --- a/spec/models/form/lettings/questions/managing_organisation_spec.rb +++ b/spec/models/form/lettings/questions/managing_organisation_spec.rb @@ -142,34 +142,19 @@ RSpec.describe Form::Lettings::Questions::ManagingOrganisation, type: :model do end describe "#hidden_in_check_answers?" do - context "when housing providers < 2" do - context "when not support user" do - let(:user) { create(:user) } - - it "is hidden in check answers" do - expect(question.hidden_in_check_answers?(nil, user)).to be true - end - end - - context "when support" do - let(:user) { create(:user, :support) } + context "when user present" do + let(:user) { create(:user) } - it "is not hiddes in check answers" do - expect(question.hidden_in_check_answers?(nil, user)).to be false - end + it "is hidden in check answers" do + expect(question.hidden_in_check_answers?(nil, user)).to be false end end - context "when managing agents >= 2" do - let(:user) { create(:user) } - - before do - create(:organisation_relationship, :managing, parent_organisation: user.organisation) - create(:organisation_relationship, :managing, parent_organisation: user.organisation) - end + context "when user not provided" do + let(:user) { create(:user, :support) } - it "is not hidden in check answers" do - expect(question.hidden_in_check_answers?(nil, user)).to be false + it "is not hiddes in check answers" do + expect(question.hidden_in_check_answers?(nil)).to be true end end end