mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
test username actually changes
This commit is contained in:
parent
180888c020
commit
c2fa314684
@ -48,9 +48,13 @@ describe UserAnonymizer do
|
|||||||
profile_background: "http://example.com/bg.jpg",
|
profile_background: "http://example.com/bg.jpg",
|
||||||
bio_cooked_version: 2,
|
bio_cooked_version: 2,
|
||||||
card_background: "http://example.com/cb.jpg")
|
card_background: "http://example.com/cb.jpg")
|
||||||
|
|
||||||
|
prev_username = user.username
|
||||||
|
|
||||||
make_anonymous
|
make_anonymous
|
||||||
user.reload
|
user.reload
|
||||||
|
|
||||||
|
expect(user.username).not_to eq(prev_username)
|
||||||
expect(user.name).not_to be_present
|
expect(user.name).not_to be_present
|
||||||
expect(user.date_of_birth).to eq(nil)
|
expect(user.date_of_birth).to eq(nil)
|
||||||
expect(user.title).not_to be_present
|
expect(user.title).not_to be_present
|
||||||
@ -72,11 +76,14 @@ describe UserAnonymizer do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "changes name to anonymized username" do
|
it "changes name to anonymized username" do
|
||||||
|
prev_username = user.username
|
||||||
|
|
||||||
user.update_attributes( name: "Bibi", date_of_birth: 19.years.ago, title: "Super Star" )
|
user.update_attributes( name: "Bibi", date_of_birth: 19.years.ago, title: "Super Star" )
|
||||||
|
|
||||||
make_anonymous
|
make_anonymous
|
||||||
user.reload
|
user.reload
|
||||||
|
|
||||||
|
expect(user.name).not_to eq(prev_username)
|
||||||
expect(user.name).to eq(user.username)
|
expect(user.name).to eq(user.username)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user