mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
FEATURE: don't allow username and password to be the same
This commit is contained in:
@ -72,6 +72,13 @@ describe PasswordValidator do
|
||||
expect(record.errors[:password]).not_to be_present
|
||||
end
|
||||
end
|
||||
|
||||
it "adds an error when password is the same as the username" do
|
||||
@password = "porkchops1"
|
||||
record.username = @password
|
||||
validate
|
||||
expect(record.errors[:password]).to be_present
|
||||
end
|
||||
end
|
||||
|
||||
context "password not required" do
|
||||
|
Reference in New Issue
Block a user