about summary refs log tree commit diff
path: root/spec/models/setting_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/setting_spec.rb')
-rw-r--r--spec/models/setting_spec.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/spec/models/setting_spec.rb b/spec/models/setting_spec.rb
index 1cc528674..3ccc21d6c 100644
--- a/spec/models/setting_spec.rb
+++ b/spec/models/setting_spec.rb
@@ -99,11 +99,12 @@ RSpec.describe Setting, type: :model do
         end
 
         it 'does not query the database' do
-          expect do |callback|
-            ActiveSupport::Notifications.subscribed callback, 'sql.active_record' do
-              described_class[key]
-            end
-          end.not_to yield_control
+          callback = double
+          allow(callback).to receive(:call)
+          ActiveSupport::Notifications.subscribed callback, 'sql.active_record' do
+            described_class[key]
+          end
+          expect(callback).not_to have_received(:call)
         end
 
         it 'returns the cached value' do