diff --git a/Gemfile.lock b/Gemfile.lock
index 322fcc403..48f6e5971 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -232,6 +232,8 @@ GEM
minitest (5.14.4)
msgpack (1.4.2)
nio4r (2.5.8)
+ nokogiri (1.12.5-x86_64-darwin)
+ racc (~> 1.4)
nokogiri (1.12.5-x86_64-linux)
racc (~> 1.4)
orm_adapter (0.5.0)
@@ -393,6 +395,7 @@ GEM
zeitwerk (2.5.1)
PLATFORMS
+ x86_64-darwin-19
x86_64-darwin-20
x86_64-linux
diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb
index 38d95b85a..7370d2a06 100644
--- a/app/views/devise/registrations/edit.html.erb
+++ b/app/views/devise/registrations/edit.html.erb
@@ -1,43 +1,26 @@
-
Edit <%= resource_name.to_s.humanize %>
-
-<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
- <%= render "devise/shared/error_messages", resource: resource %>
-
-
- <%= f.label :email %>
- <%= f.email_field :email, autofocus: true, autocomplete: "email" %>
-
-
- <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
- Currently waiting confirmation for: <%= resource.unconfirmed_email %>
- <% end %>
-
-
- <%= f.label :password %> (leave blank if you don't want to change it)
- <%= f.password_field :password, autocomplete: "new-password" %>
- <% if @minimum_password_length %>
-
- <%= @minimum_password_length %> characters minimum
- <% end %>
-
-
-
- <%= f.label :password_confirmation %>
- <%= f.password_field :password_confirmation, autocomplete: "new-password" %>
-
-
-
- <%= f.label :current_password %> (we need your current password to confirm your changes)
- <%= f.password_field :current_password, autocomplete: "current-password" %>
-
+<% content_for :before_content do %>
+ <%= link_to 'Back', :back, class: "govuk-back-link" %>
+<% end %>
-
- <%= f.submit "Update" %>
+<%= form_for(resource, as: resource_name, url: user_registration_path(), html: { method: :put }) do |f| %>
+
+
+
Change your password
+
+
+ <%= f.label :current_password, class: "govuk-label" %>
+ <%= f.password_field :current_password, autocomplete: "current-password", class: "govuk-input" %>
+
+
+
+
+ <%= f.submit "Update", class: "govuk-button" %>
+
<% end %>
-
-
Cancel my account
-
-
Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %>
-
-<%= link_to "Back", :back %>
diff --git a/app/views/users/account/index.html.erb b/app/views/users/account/index.html.erb
index 85abb6a07..8a84497a3 100644
--- a/app/views/users/account/index.html.erb
+++ b/app/views/users/account/index.html.erb
@@ -39,9 +39,7 @@
••••••••
-
- Change password
-
+ <%= link_to "Change", edit_user_registration_path %>
diff --git a/config/routes.rb b/config/routes.rb
index c9226c8df..4fc1470b8 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,7 +1,11 @@
Rails.application.routes.draw do
- devise_for :users, controllers: { passwords: "users/passwords" }
+ devise_for :users, controllers: { passwords: "users/passwords" }, :skip => [:registrations]
devise_scope :user do
get "confirmations/reset", to: "users/passwords#reset_confirmation"
+ end
+ as :user do
+ get 'users/edit' => 'devise/registrations#edit', :as => 'edit_user_registration'
+ put 'users' => 'devise/registrations#update', :as => 'user_registration'
end
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
diff --git a/spec/features/user_spec.rb b/spec/features/user_spec.rb
index 10b8ee759..857c6e48d 100644
--- a/spec/features/user_spec.rb
+++ b/spec/features/user_spec.rb
@@ -70,5 +70,10 @@ RSpec.describe "User Features" do
click_link("change-email")
expect(page).to have_content("Personal details")
end
+
+ it "edit password page present and accessible" do
+ visit("users/edit")
+ expect(page).to have_content("Change your password")
+ end
end
end