Browse Source

Set minimum password length

pull/309/head
baarkerlounger 3 years ago
parent
commit
7c4908a786
  1. 1
      app/controllers/users_controller.rb
  2. 6
      spec/requests/users_controller_spec.rb

1
app/controllers/users_controller.rb

@ -40,6 +40,7 @@ class UsersController < ApplicationController
end
def edit_password
@minimum_password_length = User.password_length.min
render "devise/passwords/edit"
end

6
spec/requests/users_controller_spec.rb

@ -168,9 +168,13 @@ RSpec.describe UsersController, type: :request do
get "/users/#{user.id}/password/edit", headers: headers, params: {}
end
it "show the edit password page" do
it "shows the edit password page" do
expect(page).to have_content("Change your password")
end
it "shows the password requirements hint" do
expect(page).to have_css("#user-password-hint")
end
end
context "when the current user does not matches the user ID" do

Loading…
Cancel
Save