Commit c75908f9 authored by Stan Hu's avatar Stan Hu

Fix typo: NotImplemented -> NotImplementedError

parent 97aa4542
......@@ -51,7 +51,7 @@ module Gitlab
end
def self.database_secondary?
raise NotImplemented unless Gitlab::Database.postgresql?
raise NotImplementedError unless Gitlab::Database.postgresql?
ActiveRecord::Base.connection.execute('SELECT pg_is_in_recovery()')
.first
......
......@@ -6,6 +6,10 @@ describe Gitlab::Geo::HealthCheck do
subject { described_class }
describe '.perform_checks' do
before do
skip("Not using PostgreSQL") unless Gitlab::Database.postgresql?
end
it 'returns an empty string when not running on a secondary node' do
allow(Gitlab::Geo).to receive(:secondary?) { false }
......@@ -38,4 +42,12 @@ describe Gitlab::Geo::HealthCheck do
expect(subject.perform_checks).not_to be_blank
end
end
describe 'MySQL checks' do
it 'raises an error' do
allow(Gitlab::Database).to receive(:postgresql?) { false }
expect { subject.perform_checks }.to raise_error(NotImplementedError)
end
end
end
......@@ -277,6 +277,10 @@ describe API::Geo, api: true do
let!(:secondary_node) { create(:geo_node) }
let(:request) { Gitlab::Geo::BaseRequest.new }
before do
skip("Not using PostgreSQL") unless Gitlab::Database.postgresql?
end
it 'responds with 401 with invalid auth header' do
get api('/geo/status'), nil, Authorization: 'Test'
......
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