Get rid of update_badges mocks.

This commit is contained in:
Vikhyat Korrapati 2014-05-15 23:13:04 +05:30
parent c07244a4e6
commit 8c2ec4c52a

View File

@ -71,21 +71,11 @@ describe BadgeGranter do
end
context "revoke" do
context "update_badges" do
let(:user) { Fabricate(:user) }
let(:logger) { StaffActionLogger.new(Fabricate(:admin)) }
it "is called by User#change_trust_level!" 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
it "grants and revokes trust level badges" do
user.change_trust_level!(:elder)
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!