DEV: Correctly pluralize error messages (#26469)

This commit is contained in:
Gerhard Schlager
2024-04-04 15:02:09 +02:00
committed by GitHub
parent 79cf7c0935
commit 82c62fe44f
9 changed files with 88 additions and 42 deletions

View File

@ -47,7 +47,7 @@ RSpec.describe UsernameValidator do
expect_invalid(
*usernames,
error_message: I18n.t(:"user.username.short", min: min_username_length),
error_message: I18n.t(:"user.username.short", count: min_username_length),
)
end
@ -62,7 +62,7 @@ RSpec.describe UsernameValidator do
expect_invalid(
"a" * (max_username_length + 1),
error_message: I18n.t(:"user.username.long", max: max_username_length),
error_message: I18n.t(:"user.username.long", count: max_username_length),
failure_reason: "Should be invalid as username length > #{max_username_length}",
)
end
@ -154,7 +154,7 @@ RSpec.describe UsernameValidator do
expect_invalid(
*usernames,
error_message: I18n.t(:"user.username.short", min: min_username_length),
error_message: I18n.t(:"user.username.short", count: min_username_length),
)
end
@ -170,7 +170,7 @@ RSpec.describe UsernameValidator do
expect_invalid(
"ם" * (max_username_length + 1),
"äl" * (max_username_length + 1),
error_message: I18n.t(:"user.username.long", max: max_username_length),
error_message: I18n.t(:"user.username.long", count: max_username_length),
failure_reason: "Should be invalid as username length are > #{max_username_length}",
)
end