Browse Source

Display managing org for sales correctly in CYA

pull/2252/head
Kat 2 years ago
parent
commit
87d3d2acaf
  1. 2
      app/models/form/sales/questions/managing_organisation.rb
  2. 16
      spec/models/form/sales/questions/managing_organisation_spec.rb

2
app/models/form/sales/questions/managing_organisation.rb

@ -59,7 +59,7 @@ class Form::Sales::Questions::ManagingOrganisation < ::Form::Question
end
def hidden_in_check_answers?(log, user = nil)
user.nil? || !user.support? || !@page.routed_to?(log, user)
user.nil? || !@page.routed_to?(log, user)
end
def enabled

16
spec/models/form/sales/questions/managing_organisation_spec.rb

@ -185,22 +185,6 @@ RSpec.describe Form::Sales::Questions::ManagingOrganisation, type: :model do
allow(page).to receive(:routed_to?).and_return(true)
end
context "when user is non support" 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 user is support" 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
end
end
context "when user not provided" do
it "is hidden in check answers" do
expect(question.hidden_in_check_answers?(nil)).to be true

Loading…
Cancel
Save