Skip to content

Commit

Permalink
Merge pull request #319 from moneyadviceservice/change_flash_messages
Browse files Browse the repository at this point in the history
Change flash messages
  • Loading branch information
munckymagik committed Oct 8, 2015
2 parents f1a0e33 + 59dbad4 commit cee06e3
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 15 deletions.
2 changes: 1 addition & 1 deletion app/views/shared/_alerts.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<% flash.to_hash.slice('notice', 'success', 'info', 'alert', 'error').each do |name, msg| %>
<%= render 'shared/notification', name: name, title: name.titleize, msg: msg, test_class: 't-flash-message' %>
<%= render 'shared/notification', name: name, title: t("notification.#{name}"), msg: msg, test_class: 't-flash-message' %>
<% end %>
6 changes: 3 additions & 3 deletions config/locales/devise.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ en:
update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address."
updated: "Your account has been updated successfully."
sessions:
signed_in: "Signed in successfully."
signed_out: "Signed out successfully."
already_signed_out: "Signed out successfully."
signed_in: You've signed in successfully
signed_out: You've signed out successfully
already_signed_out: You've signed out successfully
unlocks:
send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
Expand Down
10 changes: 9 additions & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ en:
travel_distance:
inclusion: "- please select at least one"

notification:
notice: Notice
success: Success
info: Information
alert: Alert
error: There's an error
onboarding: Welcome

error_message: Error
authentication_sign_in: Sign in
authentication_sign_up: Register
Expand Down Expand Up @@ -145,7 +153,7 @@ en:
email_address: Email address *
telephone_number: Telephone number *
fca_number_unmatched: could not be matched
validation_error_html: If you have any queries, please contact <a href="mailto:[email protected]">[email protected]</a>.
validation_error_html: We weren't able to sign you up. If you have any queries, please contact <a href="mailto:[email protected]">[email protected]</a>.
register_button: Register my firm
user:
password: Password *
Expand Down
10 changes: 5 additions & 5 deletions config/locales/self_service.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ en:
breadcrumb: "%{adviser_name}"
title: "Edit adviser: %{adviser_name}"
submit_button: Save adviser
saved: Saved successfully
saved: The adviser has been saved

adviser_new:
breadcrumb: Add an adviser
Expand All @@ -27,7 +27,7 @@ en:
deleted: "%{name} has been successfully removed."

office_add:
saved: Saved successfully
saved: The office has been saved

office_destroy:
deleted: "The %{postcode} office has been successfully removed."
Expand All @@ -42,8 +42,8 @@ en:
trading_name_edit:
breadcrumb: "%{firm_name}"
title: "Edit: %{firm_name}"
saved: Saved successfully
saved: The trading name has been saved

onboarding:
title: Onboarding
message: Enter details about your firm, advisers and offices to add it to the directory
title: Welcome
message: Please enter details about your firm, advisers and offices to add it to the directory
2 changes: 1 addition & 1 deletion config/locales/self_service/firm_edit.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ en:
firm_edit:
breadcrumb: "%{firm_name}"
title: "Edit: %{firm_name}"
saved: Saved successfully
saved: Your firm has been saved
trading_name_heading: Trading name
firm_heading: Firm
trading_name_contact_details_heading: Trading Name Contact Details
Expand Down
2 changes: 1 addition & 1 deletion config/locales/self_service/office_edit.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ en:
breadcrumb: "%{postcode}"
title: "Edit office: %{postcode}"
submit_button: Save office
saved: Saved successfully
saved: The office has been saved
2 changes: 1 addition & 1 deletion config/locales/self_service/principal_edit.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ en:
principal_edit:
breadcrumb: Edit Principal
title: Edit Principal for %{firm_name}
saved: Saved successfully
saved: Your principal has been saved
submit_button: Save principal
firm_section_explanation:
- Below are details of the person who completed the registration process on behalf of your firm. Please check this is correct and amend if necessary.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module SelfService
end

it 'adds a success flash message' do
expect(flash[:notice]).to eq('Saved successfully')
expect(flash[:notice]).to eq(I18n.t('self_service.adviser_edit.saved'))
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module SelfService
before { patch :update, firm_id: firm.id, id: adviser.id, adviser: adviser_params }

it 'adds a success message after successfully updating the adviser' do
expect(flash[:notice]).to eq('Saved successfully')
expect(flash[:notice]).to eq(I18n.t('self_service.adviser_edit.saved'))
end

it 'redirects to the edit page' do
Expand Down

0 comments on commit cee06e3

Please sign in to comment.