Skip to content

Commit 7f19de2

Browse files
authored
Merge pull request #5663 from nhsuk/mmrv-view-consent-form
Fix link to view online consent form for MMR
2 parents 182467b + a254e3e commit 7f19de2

2 files changed

Lines changed: 23 additions & 6 deletions

File tree

app/components/app_session_summary_component.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,17 @@ def online_consent_links
161161
ProgrammeGrouper
162162
.call(session.programmes)
163163
.map do |_group, programmes|
164+
names =
165+
programmes.map do |programme|
166+
# TODO: This enables us to show "MMR" for the "MMR(V)" programme
167+
# but will probably need fixing once we collect consent for MMRV.
168+
I18n.t(programme.type, scope: :programme_types)
169+
end
170+
171+
label = "View the #{names.to_sentence} online consent form"
172+
164173
helpers.govuk_link_to(
165-
"View the #{programmes.map(&:name).to_sentence} online consent form",
174+
label,
166175
start_parent_interface_consent_forms_path(
167176
session,
168177
programmes.map(&:to_param).join("-")

spec/components/app_session_summary_component_spec.rb

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@
3838
it { should have_content("Consent forms") }
3939
it { should have_link("Download the HPV consent form (PDF)") }
4040

41+
context "for MMR(V) programme" do
42+
before { Flipper.enable(:mmrv) }
43+
44+
let(:programmes) { [Programme.mmr] }
45+
46+
it { should have_link("Download the MMR consent form (PDF)") }
47+
end
48+
4149
context "when consent is open" do
4250
let(:session) do
4351
create(:session, location:, date: 1.week.from_now.to_date, programmes:)
@@ -48,14 +56,14 @@
4856
"View the HPV online consent form (opens in new tab)"
4957
)
5058
end
51-
end
5259

53-
context "for MMR(V) programme" do
54-
before { Flipper.enable(:mmrv) }
60+
context "for MMR(V) programme" do
61+
before { Flipper.enable(:mmrv) }
5562

56-
let(:programmes) { [Programme.mmr] }
63+
let(:programmes) { [Programme.mmr] }
5764

58-
it { should have_link("Download the MMR consent form (PDF)") }
65+
it { should have_link("View the MMR online consent form") }
66+
end
5967
end
6068
end
6169
end

0 commit comments

Comments
 (0)