summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/query_limiting/active_support_subscriber_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/query_limiting/active_support_subscriber_spec.rb')
-rw-r--r--spec/lib/gitlab/query_limiting/active_support_subscriber_spec.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/spec/lib/gitlab/query_limiting/active_support_subscriber_spec.rb b/spec/lib/gitlab/query_limiting/active_support_subscriber_spec.rb
index a8dd482c7b8..1ab8e22d6d1 100644
--- a/spec/lib/gitlab/query_limiting/active_support_subscriber_spec.rb
+++ b/spec/lib/gitlab/query_limiting/active_support_subscriber_spec.rb
@@ -3,7 +3,7 @@
require 'spec_helper'
RSpec.describe Gitlab::QueryLimiting::ActiveSupportSubscriber do
- let(:transaction) { instance_double(Gitlab::QueryLimiting::Transaction, increment: true) }
+ let(:transaction) { instance_double(Gitlab::QueryLimiting::Transaction, executed_sql: true, increment: true) }
before do
allow(Gitlab::QueryLimiting::Transaction)
@@ -18,6 +18,11 @@ RSpec.describe Gitlab::QueryLimiting::ActiveSupportSubscriber do
expect(transaction)
.to have_received(:increment)
.once
+
+ expect(transaction)
+ .to have_received(:executed_sql)
+ .once
+ .with(String)
end
context 'when the query is actually a rails cache hit' do
@@ -30,6 +35,11 @@ RSpec.describe Gitlab::QueryLimiting::ActiveSupportSubscriber do
expect(transaction)
.to have_received(:increment)
.once
+
+ expect(transaction)
+ .to have_received(:executed_sql)
+ .once
+ .with(String)
end
end
end