FEATURE: users with no posts shouldn't able to edit username after the allowed period. (#17583)

We are no longer going to let users change their username after the allowed `username_change_period` when there are no posts created by the user.
This commit is contained in:
Vinoth Kannan
2022-07-21 04:46:15 +05:30
committed by GitHub
parent f75a99e932
commit eef58f510c
3 changed files with 5 additions and 4 deletions

View File

@@ -2789,8 +2789,8 @@ describe Guardian do
context 'with no posts' do
include_examples "staff can always change usernames"
it "is true for the user to change their own username" do
expect(Guardian.new(target_user).can_edit_username?(target_user)).to be_truthy
it "is false for the user to change their own username" do
expect(Guardian.new(target_user).can_edit_username?(target_user)).to be_falsey
end
end