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:
authorStan Hu <stanhu@gmail.com>2019-08-29 06:54:15 +0300
committerStan Hu <stanhu@gmail.com>2019-08-29 06:54:15 +0300
commitb31b6764ac02759ac3b5ab2781023a879bdf2c8f (patch)
treeed2db0ce7870617dd770f76a7e8d72ca831bd157 /spec/lib/gitlab
parent87aa5e7ad25bf576dfdb87ddc783c9f23099b6e7 (diff)
parent9bfb012a56918e3412ce767c19f5f9ca2329a78c (diff)
Merge branch 'performance-bar-warnings' into 'master'
Add warnings to performance bar response See merge request gitlab-org/gitlab-ce!31054
Diffstat (limited to 'spec/lib/gitlab')
-rw-r--r--spec/lib/gitlab/performance_bar/with_top_level_warnings_spec.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/lib/gitlab/performance_bar/with_top_level_warnings_spec.rb b/spec/lib/gitlab/performance_bar/with_top_level_warnings_spec.rb
new file mode 100644
index 00000000000..3b92261f0fe
--- /dev/null
+++ b/spec/lib/gitlab/performance_bar/with_top_level_warnings_spec.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+require 'fast_spec_helper'
+require 'rspec-parameterized'
+
+describe Gitlab::PerformanceBar::WithTopLevelWarnings do
+ using RSpec::Parameterized::TableSyntax
+
+ subject { Module.new }
+
+ before do
+ subject.singleton_class.prepend(described_class)
+ end
+
+ describe '#has_warnings?' do
+ where(:has_warnings, :results) do
+ false | { data: {} }
+ false | { data: { gitaly: { warnings: [] } } }
+ true | { data: { gitaly: { warnings: [1] } } }
+ true | { data: { gitaly: { warnings: [] }, redis: { warnings: [1] } } }
+ end
+
+ with_them do
+ it do
+ expect(subject.has_warnings?(results)).to eq(has_warnings)
+ end
+ end
+ end
+end