FIX: Better error messages when name is too long

Previously you'd get a server side generic error due to a password check
failing. Now the input element has a maxlength attribute and the server
side will respond with a nicer error message if the value is too long.
This commit is contained in:
Robin Ward
2020-02-03 14:12:45 -05:00
parent 31775c996c
commit ee17138c0f
3 changed files with 11 additions and 5 deletions

View File

@ -65,6 +65,11 @@ describe User do
expect(user.errors.full_messages.first)
.to include(user_error_message(:name, :same_as_password))
end
it "doesn't raise an error if the name is longer than the max password length" do
user.name = 'x' * 220
expect(user).to be_valid
end
end
describe 'emails' do