-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9798 from alphagov/content-modelling/754-update-e…
…rror-messaging-across-the-journey-in-design-and-code (754) Update error messaging across the journey
- Loading branch information
Showing
20 changed files
with
317 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
lib/engines/content_block_manager/app/models/content_block_manager/content_block/edition.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,12 +115,12 @@ | |
|
||
fill_in "Title", with: @title if @title.present? | ||
|
||
select @organisation, from: "content_block/edition_lead_organisation" if @organisation.present? | ||
select @organisation, from: "content_block_manager_content_block_edition_lead_organisation" if @organisation.present? | ||
|
||
fill_in "Instructions to publishers", with: @instructions_to_publishers if @instructions_to_publishers.present? | ||
|
||
fields.keys.each do |k| | ||
fill_in "content_block_manager/content_block/edition_details_#{k}", with: @details[k] | ||
fill_in "content_block_manager_content_block_edition_details_#{k}", with: @details[k] | ||
end | ||
|
||
click_save_and_continue | ||
|
@@ -447,19 +447,19 @@ def should_show_edit_form_for_email_address_content_block(document_title, email_ | |
end | ||
|
||
Then("I see the errors informing me the date is invalid") do | ||
assert_text "Scheduled publication is not in the correct format", minimum: 2 | ||
assert_text I18n.t("activerecord.errors.models.content_block_manager/content_block/edition.attributes.scheduled_publication.time.blank"), minimum: 2 | ||
end | ||
|
||
Then("I see the error message {string}") do |text| | ||
assert_text text, minimum: 2 | ||
Then("I should see an error message telling me that schedule publishing cannot be blank") do | ||
assert_text I18n.t("activerecord.errors.models.content_block_manager/content_block/edition.attributes.schedule_publishing.blank"), minimum: 2 | ||
end | ||
|
||
Then("I see the errors informing me the date must be in the future") do | ||
assert_text "Scheduled publication date and time must be in the future", minimum: 2 | ||
assert_text I18n.t("activerecord.errors.models.content_block_manager/content_block/edition.attributes.scheduled_publication.future_date"), minimum: 2 | ||
end | ||
|
||
Then("I should see a message that the {string} field is an invalid {string}") do |field_name, format| | ||
assert_text "#{ContentBlockManager::ContentBlock::Edition.human_attribute_name("details_#{field_name}")} is an invalid #{format.titleize}" | ||
Then("I should see a message that the field is an invalid {string}") do |format| | ||
assert_text I18n.t("activerecord.errors.models.content_block_manager/content_block/edition.invalid", attribute: format) | ||
end | ||
|
||
Then("I should see a message that I need to confirm the details are correct") do | ||
|
@@ -568,7 +568,7 @@ def should_show_edit_form_for_email_address_content_block(document_title, email_ | |
end | ||
|
||
Then(/^I should see an error prompting me to choose an object type$/) do | ||
assert_text "You must select a block type" | ||
assert_text I18n.t("activerecord.errors.models.content_block_manager/content_block/document.attributes.block_type.blank") | ||
end | ||
|
||
Then(/^I am shown where the changes will take place$/) do | ||
|
@@ -775,7 +775,7 @@ def visit_edit_page | |
def change_details | ||
fill_in "Title", with: "Changed title" | ||
fill_in "Email address", with: "[email protected]" | ||
select "Ministry of Example", from: "content_block/edition_lead_organisation" | ||
select "Ministry of Example", from: "content_block_manager_content_block_edition_lead_organisation" | ||
fill_in "Instructions to publishers", with: "new context information" | ||
click_save_and_continue | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.