Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/helpers/sessions_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ def session_consent_period(session)
"Not provided"
elsif open_at.future?
"Opens #{open_at.to_fs(:short)}"
elsif close_at.today?
"Closes today at midnight"
elsif close_at.future?
"Open from #{open_at.to_fs(:short)} until #{close_at.to_fs(:short)}"
else
Expand Down
6 changes: 6 additions & 0 deletions spec/helpers/sessions_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
it { should eq("Open from 23 September until 13 October") }
end

context "when the consent period closes today" do
let(:date) { Date.new(2024, 10, 2) }

it { should eq("Closes today at midnight") }
end

context "when in the far future" do
let(:date) { Date.new(2025, 1, 1) }

Expand Down
Loading