Skip to content

Commit

Permalink
Make wording of 2-step verification consistent in views
Browse files Browse the repository at this point in the history
This ensures the name of 2SV is consistent in all public facing views.
  • Loading branch information
brucebolt committed Feb 16, 2023
1 parent e33fc93 commit ba0f46a
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def update
else
reason_for_2sv_exemption, valid_expiry_date = error_string_or_parsed_params
@user.exempt_from_2sv(reason_for_2sv_exemption, current_user, valid_expiry_date)
flash[:notice] = "User exempted from 2SV"
flash[:notice] = "User exempted from 2-step verification"
redirect_to edit_user_path(@user)
end
end
Expand Down
8 changes: 4 additions & 4 deletions app/views/organisations/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<% content_for :title, "Require 2sv for #{@organisation.name}" %>
<% content_for :title, "Require 2-step verification for #{@organisation.name}" %>

<ol class="breadcrumb">
<li><%= link_to "Organisations", organisations_path %></li>
<li class="active">Require 2sv</li>
<li class="active">Require 2-step verification</li>
</ol>

<h1 class="page-title">Require 2sv for &ldquo;<%= @organisation.name %>&rdquo;</h1>
<h1 class="page-title">Require 2-step verification for &ldquo;<%= @organisation.name %>&rdquo;</h1>

<%= form_tag organisation_path(@organisation), method: "put", :class => 'well remove-top-padding' do %>
<div class="checkbox add-top-margin">
Expand All @@ -14,7 +14,7 @@
Mandate 2-step verification for <%= @organisation.name %>
</label>
</div>
<p>This will ensure that all users in an organisation who are not exempted from 2sv must set up 2sv on their next login.</p>
<p>This will ensure that all users in an organisation who are not exempted from 2-step verification must set up 2-step verification on their next login.</p>
<p>They will not be able to perform any actions in signon before this is set up.</p>
<%= submit_tag "Update Organisation", class: "btn btn-primary add-right-margin" %>
<%= link_to "Cancel", organisations_path, class: "btn btn-default" %>
Expand Down
6 changes: 3 additions & 3 deletions app/views/two_step_verification_exemptions/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

<%= form_tag two_step_verification_exemption_path(@user), method: "patch", :class => 'well remove-top-padding' do %>
<div class="add-top-margin">
<p>You are about to exempt this user from having 2 step verification on their account. This will remove any existing
requirement to log in with, or set up 2 step verification.</p>
<p>You are about to exempt this user from having 2-step verification on their account. This will remove any existing
requirement to log in with, or set up 2-step verification.</p>
</div>
<div class="form-group">
<label for="user_reason_for_2sv_exemption">Reason for 2sv exemption</label>
<label for="user_reason_for_2sv_exemption">Reason for 2-step verification exemption</label>
<%= text_field_tag "user[reason_for_2sv_exemption]", @user.reason_for_2sv_exemption, class: 'form-control input-md-6' %>
</div>
<p>Please provide a reason for granting this exemption above.</p>
Expand Down
2 changes: 1 addition & 1 deletion app/views/users/_form_fields.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</span>
</p>
<% elsif policy(User).assign_role? %>
<p>This user's role is set to <%= @user.role %>. They are currently exempted from 2sv, meaning that their role cannot be changed as admins are required to have 2sv.</p>
<p>This user's role is set to <%= @user.role %>. They are currently exempted from 2-step verification, meaning that their role cannot be changed as admins are required to have 2-step verification.</p>
<% end %>

<% if policy(current_user).mandate_2sv? && @user.persisted? %>
Expand Down
2 changes: 1 addition & 1 deletion test/integration/change_user_role_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def sign_in_as_and_edit_user(sign_in_as, user_to_edit)

assert page.has_no_select?("Role")

assert page.has_text? "This user's role is set to #{user.role}. They are currently exempted from 2sv, meaning that their role cannot be changed as admins are required to have 2sv."
assert page.has_text? "This user's role is set to #{user.role}. They are currently exempted from 2-step verification, meaning that their role cannot be changed as admins are required to have 2-step verification."
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 @@ -90,7 +90,7 @@ def user_can_be_exempted_from_2sv(signed_in_as, user_being_exempted, reason, exp
end

def fill_in_exemption_form(reason, expiry_date)
fill_in "Reason for 2sv exemption", with: reason
fill_in "Reason for 2-step verification exemption", with: reason
fill_in_expiry_date(expiry_date)
click_button "Save"
end
Expand All @@ -109,7 +109,7 @@ def assert_user_has_been_exempted_from_2sv(user, reason, expiry_date)
assert_equal reason, user.reason_for_2sv_exemption
assert_equal expiry_date, user.expiry_date_for_2sv_exemption

assert page.has_text? "User exempted from 2SV"
assert page.has_text? "User exempted from 2-step verification"
assert page.has_text? "The user has been made exempt from 2-step verification for the following reason: #{reason}"
end

Expand Down

0 comments on commit ba0f46a

Please sign in to comment.