Browse Source

Use dash not hyphen in confirmation page button and links

pull/624/head
Paul Robert Lloyd 3 years ago
parent
commit
4a5d9b8d47
  1. 4
      app/views/users/toggle_active.html.erb
  2. 8
      spec/features/user_spec.rb
  3. 8
      spec/requests/users_controller_spec.rb

4
app/views/users/toggle_active.html.erb

@ -16,9 +16,9 @@
<%= f.govuk_text_field :active,
value: active_value %>
</div>
<%= f.govuk_submit "I’m sure - #{action} this user", warning: action == "deactivate" %>
<%= f.govuk_submit "I’m sure #{action} this user", warning: action == "deactivate" %>
<p class="govuk-body">
<%= govuk_link_to("No - I’ve changed my mind", user_path(@user)) %>
<%= govuk_link_to("No I’ve changed my mind", user_path(@user)) %>
</p>
</div>
</div>

8
spec/features/user_spec.rb

@ -391,14 +391,14 @@ RSpec.describe "User Features" do
end
it "allows to cancel user deactivation" do
click_link("No - I’ve changed my mind")
click_link("No I’ve changed my mind")
expect(page).to have_current_path("/users/#{other_user.id}")
expect(page).to have_no_content("This user has been deactivated.")
expect(page).to have_no_css(".govuk-notification-banner.govuk-notification-banner--success")
end
it "allows to deactivate the user" do
click_button("I’m sure - deactivate this user")
click_button("I’m sure deactivate this user")
expect(page).to have_current_path("/users/#{other_user.id}")
expect(page).to have_content("This user has been deactivated.")
expect(page).to have_css(".govuk-notification-banner.govuk-notification-banner--success")
@ -428,7 +428,7 @@ RSpec.describe "User Features" do
end
it "allows to cancel user reactivation" do
click_link("No - I’ve changed my mind")
click_link("No I’ve changed my mind")
expect(page).to have_current_path("/users/#{other_user.id}")
expect(page).to have_content("This user has been deactivated.")
expect(page).to have_no_css(".govuk-notification-banner.govuk-notification-banner--success")
@ -436,7 +436,7 @@ RSpec.describe "User Features" do
it "allows to reactivate the user" do
expect(notify_client).to receive(:send_email).with(email_address: other_user.email, template_id: User::USER_REACTIVATED_TEMPLATE_ID, personalisation:).once
click_button("I’m sure - reactivate this user")
click_button("I’m sure reactivate this user")
expect(page).to have_current_path("/users/#{other_user.id}")
expect(page).to have_no_content("This user has been deactivated.")
expect(page).to have_css(".govuk-notification-banner.govuk-notification-banner--success")

8
spec/requests/users_controller_spec.rb

@ -919,8 +919,8 @@ RSpec.describe UsersController, type: :request do
expect(path).to include("/users/#{other_user.id}/deactivate")
expect(page).to have_content(other_user.name)
expect(page).to have_content("Are you sure you want to deactivate this user?")
expect(page).to have_button("I’m sure - deactivate this user")
expect(page).to have_link("No - I’ve changed my mind", href: "/users/#{other_user.id}")
expect(page).to have_button("I’m sure deactivate this user")
expect(page).to have_link("No I’ve changed my mind", href: "/users/#{other_user.id}")
end
end
end
@ -940,8 +940,8 @@ RSpec.describe UsersController, type: :request do
expect(path).to include("/users/#{other_user.id}/reactivate")
expect(page).to have_content(other_user.name)
expect(page).to have_content("Are you sure you want to reactivate this user?")
expect(page).to have_button("I’m sure - reactivate this user")
expect(page).to have_link("No - I’ve changed my mind", href: "/users/#{other_user.id}")
expect(page).to have_button("I’m sure reactivate this user")
expect(page).to have_link("No I’ve changed my mind", href: "/users/#{other_user.id}")
end
end
end

Loading…
Cancel
Save