diff --git a/app/helpers/question_view_helper.rb b/app/helpers/question_view_helper.rb index fc6e6b28e..acb4fa959 100644 --- a/app/helpers/question_view_helper.rb +++ b/app/helpers/question_view_helper.rb @@ -35,7 +35,7 @@ module QuestionViewHelper return unless resource.instance_of?(Scheme) || resource.instance_of?(Location) if resource.instance_of?(Scheme) - "(S#{resource.id})" + [resource.primary_client_group, resource.secondary_client_group].compact.join(", ") + "(S#{resource.id}) " + [resource.primary_client_group, resource.secondary_client_group].compact.join(", ") elsif resource.instance_of?(Location) resource.name end diff --git a/spec/helpers/question_view_helper_spec.rb b/spec/helpers/question_view_helper_spec.rb index cf45a94be..c58fc1c69 100644 --- a/spec/helpers/question_view_helper_spec.rb +++ b/spec/helpers/question_view_helper_spec.rb @@ -151,10 +151,10 @@ RSpec.describe QuestionViewHelper do end context "when resource is a scheme" do - let(:resource) { build(:scheme, primary_client_group: "O", secondary_client_group: "E") } + let(:resource) { build(:scheme, primary_client_group: "O", secondary_client_group: "E", id: 2736276) } it "returns the primary and secondary client groups" do - expect(answer_option_hint(resource)).to eq("Homeless families with support needs, People with mental health problems") + expect(answer_option_hint(resource)).to eq("(S2736276) Homeless families with support needs, People with mental health problems") end end