Skip to content

Commit fdee147

Browse files
authored
Merge pull request #3944 from nhsuk/has-multiple-dates-not-today
Use future dates in has_multiple_dates
2 parents d325fb3 + 6513de6 commit fdee147

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)