DEV: Make sure max_username_length is within MAX_USERNAME_LENGTH_RANGE (#23104)
This commit is contained in:
parent
ee61fe5a2b
commit
fdfb3a362a
|
@ -27,7 +27,12 @@ RSpec.describe UsernameValidator do
|
|||
end
|
||||
end
|
||||
|
||||
let(:max_username_length) { User.maximum("length(username)") }
|
||||
let(:max_username_length) do
|
||||
[
|
||||
User.maximum("length(username)"),
|
||||
MaxUsernameLengthValidator::MAX_USERNAME_LENGTH_RANGE.begin,
|
||||
].max
|
||||
end
|
||||
let(:min_username_length) { User.minimum("length(username)") }
|
||||
|
||||
shared_examples "ASCII username" do
|
||||
|
|
Loading…
Reference in New Issue