Browse Source

Set minimum password length (#309)

pull/314/head
baarkerlounger 3 years ago committed by GitHub
parent
commit
62a685336c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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