Disable query limiting warnings for now on GitLab.com

This commit is contained in:
Stan Hu 2018-02-12 11:15:26 -08:00
parent 498ade4801
commit 04b642889a
2 changed files with 7 additions and 5 deletions

View File

@ -6,7 +6,7 @@ module Gitlab
# This ensures we don't produce any errors that users can't do anything
# about themselves.
def self.enable?
Gitlab.com? || Rails.env.development? || Rails.env.test?
Rails.env.development? || Rails.env.test?
end
# Allows the current request to execute any number of SQL queries.

View File

@ -12,14 +12,16 @@ describe Gitlab::QueryLimiting do
expect(described_class.enable?).to eq(true)
end
it 'returns true on GitLab.com' do
it 'returns false on GitLab.com' do
expect(Rails.env).to receive(:development?).and_return(false)
expect(Rails.env).to receive(:test?).and_return(false)
allow(Gitlab).to receive(:com?).and_return(true)
expect(described_class.enable?).to eq(true)
expect(described_class.enable?).to eq(false)
end
it 'returns true in a non GitLab.com' do
expect(Gitlab).to receive(:com?).and_return(false)
it 'returns false in a non GitLab.com' do
allow(Gitlab).to receive(:com?).and_return(false)
expect(Rails.env).to receive(:development?).and_return(false)
expect(Rails.env).to receive(:test?).and_return(false)