Phx.gen.auth validate_password related test failed

Hi

  1. after run phx.gen.auth Users User users command, all the test passed.

  2. I update the private function
    from

     defp validate_password(changeset, opts) do
        changeset
        |> validate_required([:password])
        |> validate_length(:password, min: 12, max: 72)
    end
    

    to

    defp validate_password(changeset, opts) do
        changeset
        |> validate_required([:password])
        |> validate_length(:password, min: 6, max: 72)
    end
    
  3. replace 12 characters to 6 characters in all test files as the following

However, I got 8 test failed like the following

Is there any other place I need to modify to make the 8 tests passed?

Thanks! :smiley:

General note: prefer text for posting error messages instead of screenshots.

The error there indicates that the password field is being filled in with the string too short (9 characters) which is now not short enough to trigger the validation.

1 Like