diff --git a/spec/controllers/admin/users_controller_spec.rb b/spec/controllers/admin/users_controller_spec.rb index 8831e660bf9..9deedfb62a6 100644 --- a/spec/controllers/admin/users_controller_spec.rb +++ b/spec/controllers/admin/users_controller_spec.rb @@ -171,12 +171,12 @@ describe Admin::UsersController do it "raises an error when the user doesn't have permission" do Guardian.any_instance.expects(:can_change_trust_level?).with(@another_user).returns(false) xhr :put, :trust_level, user_id: @another_user.id - response.should be_forbidden + response.should_not be_success end it "returns a 404 if the username doesn't exist" do xhr :put, :trust_level, user_id: 123123 - response.should be_forbidden + response.should_not be_success end it "upgrades the user's trust level" do @@ -184,6 +184,7 @@ describe Admin::UsersController do xhr :put, :trust_level, user_id: @another_user.id, level: 2 @another_user.reload @another_user.trust_level.should == 2 + response.should be_success end it "raises an error when demoting a user below their current trust level" do @@ -195,7 +196,7 @@ describe Admin::UsersController do stat.save! @another_user.update_attributes(trust_level: TrustLevel.levels[:basic]) xhr :put, :trust_level, user_id: @another_user.id, level: TrustLevel.levels[:newuser] - response.should be_forbidden + response.should_not be_success end end