From 16d4e4b4e680343a36e8ea38ec009b9a982b6b84 Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Sat, 27 Nov 2021 16:59:00 +0500 Subject: [PATCH] Fix throttling condition --- app/lib/shunter/integration/throttle.rb | 2 +- test/test_helper.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/lib/shunter/integration/throttle.rb b/app/lib/shunter/integration/throttle.rb index 0b4517112..91fb033ac 100644 --- a/app/lib/shunter/integration/throttle.rb +++ b/app/lib/shunter/integration/throttle.rb @@ -14,7 +14,7 @@ module Shunter around_action :throttle, only: actions def throttle - unless throttled_user.present? && Shunter.feature_enabled? + if throttled_user.blank? || !Shunter.feature_enabled? yield if block_given? return end diff --git a/test/test_helper.rb b/test/test_helper.rb index cce9afa97..0cd407f84 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -18,6 +18,7 @@ require 'capybara/minitest' require 'webmock/minitest' require 'support/assertions/epp_assertions' require 'sidekiq/testing' +require 'spy/integration' Sidekiq::Testing.fake!