-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Send multiple session dates to GOV.UK Notify
This updates the GOV.UK Notify personalisation to include all the session dates. I've already updated all the templates in GOV.UK Notify to use these new personalisation variables.
- Loading branch information
1 parent
2eb84aa
commit 03235b3
Showing
2 changed files
with
53 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,8 +32,8 @@ | |
location:, | ||
team:, | ||
programme:, | ||
close_consent_at: Date.new(2024, 1, 1), | ||
date: Date.new(2024, 1, 1) | ||
close_consent_at: Date.new(2026, 1, 1), | ||
date: Date.new(2026, 1, 1) | ||
) | ||
end | ||
let(:consent) { nil } | ||
|
@@ -44,15 +44,16 @@ | |
it do | ||
expect(personalisation).to eq( | ||
{ | ||
close_consent_date: "Monday 1 January", | ||
close_consent_date: "Thursday 1 January", | ||
close_consent_short_date: "1 January", | ||
consent_link: | ||
"http://localhost:4000/sessions/#{session.id}/consents/start", | ||
full_and_preferred_patient_name: "John Smith", | ||
location_name: "Hogwarts", | ||
next_session_date: "Thursday 1 January", | ||
next_session_dates: "Thursday 1 January", | ||
next_session_dates_or: "Thursday 1 January", | ||
programme_name: "Flu", | ||
session_date: "Monday 1 January", | ||
session_short_date: "1 January", | ||
short_patient_name: "John", | ||
short_patient_name_apos: "John’s", | ||
team_email: "[email protected]", | ||
|
@@ -63,6 +64,22 @@ | |
) | ||
end | ||
|
||
context "with multiple dates" do | ||
before { create(:session_date, session:, value: Date.new(2026, 1, 2)) } | ||
|
||
it do | ||
expect(personalisation).to match( | ||
hash_including( | ||
next_session_date: "Thursday 1 January", | ||
next_session_dates: "Thursday 1 January and Friday 2 January", | ||
next_session_dates_or: "Thursday 1 January or Friday 2 January", | ||
subsequent_session_dates_offered_message: | ||
"If they’re not seen, they’ll be offered the vaccination on Friday 2 January." | ||
) | ||
) | ||
end | ||
end | ||
|
||
context "with a consent" do | ||
let(:consent) do | ||
create(:consent, :refused, programme:, recorded_at: Date.new(2024, 1, 1)) | ||
|