Skip to content

Commit 6513de6

Browse files
committed
Use future dates in has_multiple_dates
Only dates in the future are shown in the consent request email, so we should update `has_multiple_dates` to work in the same way so the content is consistent between the dates shown and whether to include a sentence about multiple dates. Jira-Issue: MAV-1277
1 parent f69f475 commit 6513de6

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

app/lib/govuk_notify_personalisation.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,7 @@ def full_and_preferred_patient_name
162162
def has_multiple_dates
163163
return nil if session.nil?
164164

165-
if session.today_or_future_dates.length > 1
166-
"yes"
167-
else
168-
"no"
169-
end
165+
session.future_dates.length > 1 ? "yes" : "no"
170166
end
171167

172168
def host

spec/lib/govuk_notify_personalisation_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104

105105
it "doesn't show today's date in next date" do
106106
expect(to_h).to include(
107+
has_multiple_dates: "no",
107108
next_or_today_session_date: Date.current.to_fs(:short_day_of_week),
108109
next_session_date: Date.tomorrow.to_fs(:short_day_of_week)
109110
)

0 commit comments

Comments
 (0)