summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/database/reindexing/grafana_notifier_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/database/reindexing/grafana_notifier_spec.rb')
-rw-r--r--spec/lib/gitlab/database/reindexing/grafana_notifier_spec.rb14
1 files changed, 10 insertions, 4 deletions
diff --git a/spec/lib/gitlab/database/reindexing/grafana_notifier_spec.rb b/spec/lib/gitlab/database/reindexing/grafana_notifier_spec.rb
index 1bccdda3be1..e67c97cbf9c 100644
--- a/spec/lib/gitlab/database/reindexing/grafana_notifier_spec.rb
+++ b/spec/lib/gitlab/database/reindexing/grafana_notifier_spec.rb
@@ -12,7 +12,7 @@ RSpec.describe Gitlab::Database::Reindexing::GrafanaNotifier do
let(:action) { create(:reindex_action) }
before do
- swapout_view_for_table(:postgres_indexes)
+ swapout_view_for_table(:postgres_indexes, connection: ApplicationRecord.connection)
end
let(:headers) do
@@ -25,7 +25,9 @@ RSpec.describe Gitlab::Database::Reindexing::GrafanaNotifier do
let(:response) { double('response', success?: true) }
def expect_api_call(payload)
- expect(Gitlab::HTTP).to receive(:post).with("#{api_url}/api/annotations", body: payload.to_json, headers: headers, allow_local_requests: true).and_return(response)
+ expect(Gitlab::HTTP).to receive(:post).with(
+ "#{api_url}/api/annotations", body: payload.to_json, headers: headers, allow_local_requests: true
+ ).and_return(response)
end
shared_examples_for 'interacting with Grafana annotations API' do
@@ -109,7 +111,9 @@ RSpec.describe Gitlab::Database::Reindexing::GrafanaNotifier do
end
context 'additional tag is provided' do
- subject { described_class.new(api_key: api_key, api_url: api_url, additional_tag: additional_tag).notify_start(action) }
+ subject do
+ described_class.new(api_key: api_key, api_url: api_url, additional_tag: additional_tag).notify_start(action)
+ end
let(:payload) do
{
@@ -163,7 +167,9 @@ RSpec.describe Gitlab::Database::Reindexing::GrafanaNotifier do
end
context 'additional tag is provided' do
- subject { described_class.new(api_key: api_key, api_url: api_url, additional_tag: additional_tag).notify_end(action) }
+ subject do
+ described_class.new(api_key: api_key, api_url: api_url, additional_tag: additional_tag).notify_end(action)
+ end
let(:payload) do
{