Skip to content

Commit

Permalink
Copy changes for the mandate 2SV page
Browse files Browse the repository at this point in the history
As requested by Etain. Note that as discussed, I haven't made similar
changes to the "edit user" page, because that's about to be changed
significantly when we convert it to use the GOV.UK Design System.
  • Loading branch information
floehopper committed Nov 28, 2023
1 parent d448c0d commit d618833
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
13 changes: 6 additions & 7 deletions app/views/users/two_step_verification_mandations/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% content_for :title_caption, "Manage other users" %>
<% content_for :title, "Mandate 2-step verification for #{@user.name}" %>
<% content_for :title, "Turn on 2-step verification for #{@user.name}" %>

<% content_for :breadcrumbs,
render("govuk_publishing_components/components/breadcrumbs", {
Expand All @@ -18,7 +18,7 @@
url: edit_user_path(@user),
},
{
title: "Mandate 2-step verification",
title: "Turn on 2-step verification",
}
]
})
Expand All @@ -42,15 +42,14 @@
<div class="govuk-grid-column-two-thirds">
<%= form_for @user, url: user_two_step_verification_mandation_path(@user) do |f| %>
<%= render "govuk_publishing_components/components/hint", {
text: [
"Mandate 2-step verification for this user#{@user.exempt_from_2sv? ? ' (this will remove their exemption)' : nil}.",
"They will be prompted to set up 2-step verification again the next time they sign in.",
].join(" ")
text: @user.exempt_from_2sv? ?
"This will remove the user's exemption from 2-step verification. They will have to set up 2-step verification the next time they sign in." :
"This forces the user to set up 2-step verification the next time they sign in."
} %>

<div class="govuk-button-group">
<%= render "govuk_publishing_components/components/button", {
text: "Mandate 2-step verification",
text: "Turn on 2-step verification",
destructive: @user.exempt_from_2sv?,
} %>
<%= link_to "Cancel", edit_user_path(@user), class: "govuk-link govuk-link--no-visited-state" %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Users::TwoStepVerificationMandationsControllerTest < ActionController::Tes

assert_template :edit
assert_select "form[action='#{user_two_step_verification_mandation_path(user)}']" do
assert_select "button[type='submit']", text: "Mandate 2-step verification"
assert_select "button[type='submit']", text: "Turn on 2-step verification"
assert_select "a[href='#{edit_user_path(user)}']", text: "Cancel"
end
end
Expand Down
4 changes: 2 additions & 2 deletions test/support/managing_two_sv_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def assert_user_access_log_contains_messages(user, messages)

def mandate_2sv_for_exempted_user
click_link "Mandate 2-step verification for this user (this will remove their exemption)"
click_button "Mandate 2-step verification"
click_button "Turn on 2-step verification"
end

def admin_can_send_2sv_email(admin, user)
Expand All @@ -30,7 +30,7 @@ def admin_can_send_2sv_email(admin, user)

perform_enqueued_jobs do
click_link "Mandate 2-step verification for this user"
click_button "Mandate 2-step verification"
click_button "Turn on 2-step verification"

assert last_email
assert_equal "Make your Signon account more secure", last_email.subject
Expand Down

0 comments on commit d618833

Please sign in to comment.