From 4bcd4e05b8e088f40db39e4abde542a82bac481e Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 30 Sep 2014 13:15:02 +1000 Subject: [PATCH] correct spec --- spec/controllers/admin/users_controller_spec.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spec/controllers/admin/users_controller_spec.rb b/spec/controllers/admin/users_controller_spec.rb index 948b88adae1..fc24ebfa001 100644 --- a/spec/controllers/admin/users_controller_spec.rb +++ b/spec/controllers/admin/users_controller_spec.rb @@ -187,8 +187,7 @@ describe Admin::UsersController do response.should be_success end - it "raises an error when demoting a user below their current trust level" do - StaffActionLogger.any_instance.expects(:log_trust_level_change).never + it "raises no error when demoting a user below their current trust level (locks trust level)" do stat = @another_user.user_stat stat.topics_entered = SiteSetting.tl1_requires_topics_entered + 1 stat.posts_read_count = SiteSetting.tl1_requires_read_posts + 1 @@ -196,7 +195,9 @@ describe Admin::UsersController do stat.save! @another_user.update_attributes(trust_level: TrustLevel[1]) xhr :put, :trust_level, user_id: @another_user.id, level: TrustLevel[0] - response.should_not be_success + response.should be_success + @another_user.reload + @another_user.trust_level_locked.should == true end end