mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Don't ever grant badges when they're disabled
This commit is contained in:
@@ -106,7 +106,14 @@ describe BadgeGranter do
|
||||
|
||||
expect(user_badge.granted_at).to eq(time)
|
||||
expect(Notification.where(user_id: user.id).count).to eq(0)
|
||||
end
|
||||
|
||||
it "doesn't grant disabled badges" do
|
||||
badge = Fabricate(:badge, badge_type_id: BadgeType::Bronze, enabled: false)
|
||||
time = 1.year.ago
|
||||
|
||||
user_badge = BadgeGranter.grant(badge, user, created_at: time)
|
||||
expect(user_badge).to eq(nil)
|
||||
end
|
||||
|
||||
it 'grants multiple badges' do
|
||||
|
||||
Reference in New Issue
Block a user