Skip to content

Commit

Permalink
correct spec
Browse files Browse the repository at this point in the history
  • Loading branch information
SamSaffron committed Sep 30, 2014
1 parent 0fc6c75 commit 4bcd4e0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions spec/controllers/admin/users_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -187,16 +187,17 @@
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
stat.time_read = SiteSetting.tl1_requires_time_spent_mins * 60
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

Expand Down

0 comments on commit 4bcd4e0

Please sign in to comment.