FIX: Badge granter was disabled by default.

FIX: Badge granter was disabled by default.

diff --git a/app/services/badge_granter.rb b/app/services/badge_granter.rb
index e402fb8..a5027c5 100644
--- a/app/services/badge_granter.rb
+++ b/app/services/badge_granter.rb
@@ -3,11 +3,11 @@
 class BadgeGranter
 
   def self.disable_queue
-    @queue_enabled = false
+    @queue_disabled = true
   end
 
   def self.enable_queue
-    @queue_enabled = true
+    @queue_disabled = false
   end
 
   def initialize(badge, user, opts = {})
@@ -124,7 +124,7 @@ class BadgeGranter
   end
 
   def self.queue_badge_grant(type, opt)
-    return if !SiteSetting.enable_badges || !@queue_enabled
+    return if !SiteSetting.enable_badges || @queue_disabled
     payload = nil
 
     case type
diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb
index cd235fe..256de29 100644
--- a/spec/rails_helper.rb
+++ b/spec/rails_helper.rb
@@ -131,6 +131,9 @@ module TestSetup
 
     # Don't track ApplicationRequests in test mode unless opted in
     ApplicationRequest.disable
+
+    # Don't queue badge grant in test mode
+    BadgeGranter.disable_queue
   end
 end
 

GitHub sha: 68db5dea