mirror of
https://github.com/discourse/discourse.git
synced 2025-09-09 12:21:04 +08:00
Users cannot change their own username after 3 days since registering. Site setting username_change_period allows you to change the number of days.
This commit is contained in:
parent
ffcf3f7e7d
commit
b36c6d7b78
8 changed files with 61 additions and 4 deletions
|
@ -521,8 +521,8 @@ describe UsersController do
|
|||
lambda { xhr :put, :username, username: user.username }.should raise_error(ActionController::ParameterMissing)
|
||||
end
|
||||
|
||||
it 'raises an error when you don\'t have permission to change the user' do
|
||||
Guardian.any_instance.expects(:can_edit?).with(user).returns(false)
|
||||
it 'raises an error when you don\'t have permission to change the username' do
|
||||
Guardian.any_instance.expects(:can_edit_username?).with(user).returns(false)
|
||||
xhr :put, :username, username: user.username, new_username: new_username
|
||||
response.should be_forbidden
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue