mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: fallback to anonymous not user when suggesting usernames for anonymous users (#15354)
This commit is contained in:
committed by
GitHub
parent
852dc85504
commit
952bebc5a1
@@ -78,6 +78,16 @@ describe AnonymousShadowCreator do
|
||||
|
||||
expect { AnonymousShadowCreator.get(user) }.to_not raise_error
|
||||
end
|
||||
end
|
||||
|
||||
it "falls back to username 'anonymous' if the translation for 'anonymous' consists entirely of disallowed characters" do
|
||||
# use russian locale but do not allow russian characters:
|
||||
I18n.locale = :ru
|
||||
SiteSetting.unicode_usernames = true
|
||||
SiteSetting.allowed_unicode_username_characters = "[äöü]"
|
||||
|
||||
shadow = AnonymousShadowCreator.get(user)
|
||||
|
||||
expect(shadow.username).to eq("anonymous")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user