Browse Source

Adjust test with updated method

pull/2499/head
Manny Dinssa 2 years ago
parent
commit
4642a1360c
  1. 2
      app/helpers/question_view_helper.rb
  2. 4
      spec/helpers/question_view_helper_spec.rb

2
app/helpers/question_view_helper.rb

@ -35,7 +35,7 @@ module QuestionViewHelper
return unless resource.instance_of?(Scheme) || resource.instance_of?(Location) return unless resource.instance_of?(Scheme) || resource.instance_of?(Location)
if resource.instance_of?(Scheme) 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) elsif resource.instance_of?(Location)
resource.name resource.name
end end

4
spec/helpers/question_view_helper_spec.rb

@ -151,10 +151,10 @@ RSpec.describe QuestionViewHelper do
end end
context "when resource is a scheme" do 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 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
end end

Loading…
Cancel
Save