Commit 2e532882 authored by atanayno's avatar atanayno Committed by Vitali Tatarintev

Add tests for GrafaIntegration token

parent 386ee2b5
...@@ -5,6 +5,8 @@ require 'spec_helper' ...@@ -5,6 +5,8 @@ require 'spec_helper'
RSpec.describe Gitlab::Doctor::Secrets do RSpec.describe Gitlab::Doctor::Secrets do
let!(:user) { create(:user, otp_secret: "test") } let!(:user) { create(:user, otp_secret: "test") }
let!(:group) { create(:group, runners_token: "test") } let!(:group) { create(:group, runners_token: "test") }
let!(:project) { create(:project) }
let!(:grafana_integration) { create(:grafana_integration, project: project, token: "test") }
let(:logger) { double(:logger).as_null_object } let(:logger) { double(:logger).as_null_object }
subject { described_class.new(logger).run! } subject { described_class.new(logger).run! }
...@@ -39,4 +41,12 @@ RSpec.describe Gitlab::Doctor::Secrets do ...@@ -39,4 +41,12 @@ RSpec.describe Gitlab::Doctor::Secrets do
subject subject
end end
end end
context 'when GrafanaIntegration token is set via private method' do
it 'can access GrafanaIntegration token value' do
expect(logger).to receive(:info).with(/GrafanaIntegration failures: 0/)
subject
end
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment