diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 09:40:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 09:40:42 +0000 |
commit | ee664acb356f8123f4f6b00b73c1e1cf0866c7fb (patch) | |
tree | f8479f94a28f66654c6a4f6fb99bad6b4e86a40e /spec/lib/gitlab/query_limiting | |
parent | 62f7d5c5b69180e82ae8196b7b429eeffc8e7b4f (diff) | |
download | gitlab-ce-ee664acb356f8123f4f6b00b73c1e1cf0866c7fb.tar.gz |
Add latest changes from gitlab-org/gitlab@15-5-stable-eev15.5.0-rc42
Diffstat (limited to 'spec/lib/gitlab/query_limiting')
-rw-r--r-- | spec/lib/gitlab/query_limiting/transaction_spec.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/lib/gitlab/query_limiting/transaction_spec.rb b/spec/lib/gitlab/query_limiting/transaction_spec.rb index 27da1f23556..d8eb2040ccc 100644 --- a/spec/lib/gitlab/query_limiting/transaction_spec.rb +++ b/spec/lib/gitlab/query_limiting/transaction_spec.rb @@ -52,7 +52,7 @@ RSpec.describe Gitlab::QueryLimiting::Transaction do context 'when the query threshold is exceeded' do let(:transaction) do trans = described_class.new - trans.count = described_class::THRESHOLD + 1 + trans.count = described_class.threshold + 1 trans end @@ -120,7 +120,7 @@ RSpec.describe Gitlab::QueryLimiting::Transaction do it 'returns true when the threshold is exceeded' do transaction = described_class.new - transaction.count = described_class::THRESHOLD + 1 + transaction.count = described_class.threshold + 1 expect(transaction.threshold_exceeded?).to eq(true) end @@ -129,7 +129,7 @@ RSpec.describe Gitlab::QueryLimiting::Transaction do describe '#error_message' do it 'returns the error message to display when the threshold is exceeded' do transaction = described_class.new - transaction.count = max = described_class::THRESHOLD + transaction.count = max = described_class.threshold expect(transaction.error_message).to eq( "Too many SQL queries were executed: a maximum of #{max} " \ @@ -139,7 +139,7 @@ RSpec.describe Gitlab::QueryLimiting::Transaction do it 'includes a list of executed queries' do transaction = described_class.new - transaction.count = max = described_class::THRESHOLD + transaction.count = max = described_class.threshold %w[foo bar baz].each { |sql| transaction.executed_sql(sql) } message = transaction.error_message @@ -154,7 +154,7 @@ RSpec.describe Gitlab::QueryLimiting::Transaction do it 'indicates if the log is truncated' do transaction = described_class.new - transaction.count = described_class::THRESHOLD * 2 + transaction.count = described_class.threshold * 2 message = transaction.error_message @@ -163,7 +163,7 @@ RSpec.describe Gitlab::QueryLimiting::Transaction do it 'includes the action name in the error message when present' do transaction = described_class.new - transaction.count = max = described_class::THRESHOLD + transaction.count = max = described_class.threshold transaction.action = 'UsersController#show' expect(transaction.error_message).to eq( |