diff options
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/git_access_snippet_spec.rb | 10 | ||||
-rw-r--r-- | spec/lib/gitlab/middleware/rails_queue_duration_spec.rb | 9 |
2 files changed, 8 insertions, 11 deletions
diff --git a/spec/lib/gitlab/git_access_snippet_spec.rb b/spec/lib/gitlab/git_access_snippet_spec.rb index 877a760152d..f52fe8ef612 100644 --- a/spec/lib/gitlab/git_access_snippet_spec.rb +++ b/spec/lib/gitlab/git_access_snippet_spec.rb @@ -209,16 +209,6 @@ describe Gitlab::GitAccessSnippet do expect { push_access_check }.to raise_forbidden('foo') end - - context 'when feature flag :snippet_count_check is disabled' do - it 'does not check push file count' do - stub_feature_flags(snippet_count_check: false) - - expect(Gitlab::Checks::PushFileCountCheck).not_to receive(:new) - - expect { push_access_check }.not_to raise_error - end - end end private diff --git a/spec/lib/gitlab/middleware/rails_queue_duration_spec.rb b/spec/lib/gitlab/middleware/rails_queue_duration_spec.rb index 31359abdce3..4f21bd14122 100644 --- a/spec/lib/gitlab/middleware/rails_queue_duration_spec.rb +++ b/spec/lib/gitlab/middleware/rails_queue_duration_spec.rb @@ -9,7 +9,7 @@ describe Gitlab::Middleware::RailsQueueDuration do let(:transaction) { Gitlab::Metrics::WebTransaction.new(env) } before do - expect(app).to receive(:call).with(env).and_return('yay') + allow(app).to receive(:call).with(env).and_return('yay') end describe '#call' do @@ -42,6 +42,13 @@ describe Gitlab::Middleware::RailsQueueDuration do expect(middleware.call(env)).to eq('yay') end end + + it 'creates a metric with a docstring' do + metric = middleware.send(:metric_rails_queue_duration_seconds) + + expect(metric).to be_instance_of(Prometheus::Client::Histogram) + expect(metric.docstring).to eq('Measures latency between GitLab Workhorse forwarding a request to Rails') + end end end end |