diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-15 18:10:57 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-15 18:10:57 +0300 |
commit | e5c7d631a84940c66e46f1824ba7ce0c7f1d0ea4 (patch) | |
tree | ac1cce129d8c8cdcee6a668e27d8034d2da172e4 /spec/support/gitlab | |
parent | 0687020509cafe1e24eb0bfa0e0f5c9f6c4799d2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/gitlab')
-rw-r--r-- | spec/support/gitlab/usage/metrics_instrumentation_shared_examples.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/spec/support/gitlab/usage/metrics_instrumentation_shared_examples.rb b/spec/support/gitlab/usage/metrics_instrumentation_shared_examples.rb index de9735df546..4624a8ac82a 100644 --- a/spec/support/gitlab/usage/metrics_instrumentation_shared_examples.rb +++ b/spec/support/gitlab/usage/metrics_instrumentation_shared_examples.rb @@ -6,7 +6,9 @@ RSpec.shared_examples 'a correct instrumented metric value' do |params| let(:metric) { described_class.new(time_frame: time_frame, options: options) } before do - allow(ActiveRecord::Base.connection).to receive(:transaction_open?).and_return(false) + if described_class.respond_to?(:relation) && described_class.relation.respond_to?(:connection) + allow(described_class.relation.connection).to receive(:transaction_open?).and_return(false) + end end it 'has correct value' do |