mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 18:36:35 +08:00
Get rid of update_badges mocks.
This commit is contained in:
parent
c07244a4e6
commit
8c2ec4c52a
|
@ -71,21 +71,11 @@ describe BadgeGranter do
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context "revoke" do
|
context "update_badges" do
|
||||||
let(:user) { Fabricate(:user) }
|
let(:user) { Fabricate(:user) }
|
||||||
let(:logger) { StaffActionLogger.new(Fabricate(:admin)) }
|
let(:logger) { StaffActionLogger.new(Fabricate(:admin)) }
|
||||||
|
|
||||||
it "is called by User#change_trust_level!" do
|
it "grants and revokes trust level badges" do
|
||||||
BadgeGranter.expects(:update_badges)
|
|
||||||
user.change_trust_level!(:basic)
|
|
||||||
end
|
|
||||||
|
|
||||||
it "is called by BoostTrustLevel#save!" do
|
|
||||||
BadgeGranter.expects(:update_badges)
|
|
||||||
BoostTrustLevel.new(user: user, level: 1, logger: logger).save!
|
|
||||||
end
|
|
||||||
|
|
||||||
it "grants and revokes badges" do
|
|
||||||
user.change_trust_level!(:elder)
|
user.change_trust_level!(:elder)
|
||||||
UserBadge.where(user_id: user.id, badge_id: Badge.trust_level_badge_ids).count.should eq(4)
|
UserBadge.where(user_id: user.id, badge_id: Badge.trust_level_badge_ids).count.should eq(4)
|
||||||
BoostTrustLevel.new(user: user, level: 1, logger: logger).save!
|
BoostTrustLevel.new(user: user, level: 1, logger: logger).save!
|
||||||
|
|
Loading…
Reference in New Issue
Block a user