mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +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:
@ -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
|
||||
|
Reference in New Issue
Block a user