Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/query_limiting_spec.rb')
-rw-r--r--spec/lib/gitlab/query_limiting_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/lib/gitlab/query_limiting_spec.rb b/spec/lib/gitlab/query_limiting_spec.rb
index 0fcd865567d..4f70c65adca 100644
--- a/spec/lib/gitlab/query_limiting_spec.rb
+++ b/spec/lib/gitlab/query_limiting_spec.rb
@@ -63,6 +63,20 @@ RSpec.describe Gitlab::QueryLimiting do
expect(transaction.count).to eq(before)
end
+
+ it 'whitelists when enabled' do
+ described_class.whitelist('https://example.com')
+
+ expect(transaction.whitelisted).to eq(true)
+ end
+
+ it 'does not whitelist when disabled' do
+ allow(described_class).to receive(:enable?).and_return(false)
+
+ described_class.whitelist('https://example.com')
+
+ expect(transaction.whitelisted).to eq(false)
+ end
end
end
end