Skip to content

Commit

Permalink
Merge pull request #2126 from unboxed/allow-future-press-notice-dates
Browse files Browse the repository at this point in the history
Allow officers to put in future dates for press notices
  • Loading branch information
pixeltrix authored Jan 22, 2025
2 parents a532dfc + 87d1b05 commit ff3b9c3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/models/press_notice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class NotCreatableError < StandardError; end
with_options on: :confirmation do
validates :published_at, presence: true,
date: {
on_or_before: :current,
on_or_before: :consultation_end_date,
on_or_after: :consultation_start_date
}
end
Expand Down
2 changes: 1 addition & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ en:
date_blank: Provide the date when the press notice was published
date_invalid: The date the press notice was published must be a valid date
date_not_on_or_after: The date the press notice was published must be on or after the consultation start date
date_not_on_or_before: The date the press notice was published must be on or before today
date_not_on_or_before: The date the press notice was published must be on or before the consultation end date
reasons:
blank: Provide a reason for the press notice
required:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@
end

click_button "Save"
expect(page).to have_content("The date the press notice was published must be on or before today")
expect(page).to have_content("The date the press notice was published must be on or before the consultation end date")

within("#published-at-field") do
fill_in "Day", with: "29"
Expand Down

0 comments on commit ff3b9c3

Please sign in to comment.