-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
show errors if confirm not checked on review page #9697
show errors if confirm not checked on review page #9697
Conversation
0e1fceb
to
5e69626
Compare
@@ -61,6 +61,7 @@ def edit_draft | |||
|
|||
def review | |||
@content_block_edition = ContentBlockManager::ContentBlock::Edition.find(params[:id]) | |||
@review_errors = [REVIEW_ERROR.new(attribute: "is_confirmed", full_message: "Confirm details are correct")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this used anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah nope
def publish | ||
if params[:step] == NEW_BLOCK_STEPS[:review] && params[:is_confirmed].blank? | ||
raise StandardError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to raise here? Could we not just have the code from line 132 and down inside the conditional, and then wrap the happy path in an else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true! I guess it doesn't have to be an error, have turned into an if statement
5d30ead
to
796bd53
Compare
Because this is not an active record error we have to have some custom behaviour here. Currently the review page is only shown for the create/new journey, so have checked we are on the 'new' step here.
796bd53
to
00c6b19
Compare
assert_text "Email address scheduled to publish on #{@future_date.strftime('%e %B %Y%l:%M%P').strip}" | ||
assert_text "Email address scheduled to publish on #{@future_date.strftime('%e %B %Y %l:%M%P')}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think let's just remove the date altogether here - it makes sense to not have our feature tests so specific
this was causing tests to be flakey because sometimes it would format with the space padded before time, sometimes without. https://gds.slack.com/archives/C0776B04EJU/p1733396809325189
00c6b19
to
1252dd2
Compare
DO NOT MERGE: Unless between 11:30-14:00
Because this is not an active record error we have to have some custom behaviour here. Not sure if this is the best way!
Currently the review page is only shown for the create/new journey, so have checked we are on the 'new' step here.
mural
code
Follow these steps if you are doing a Rails upgrade.