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/support/shared_examples/services/metrics/dashboard_shared_examples.rb')
-rw-r--r--spec/support/shared_examples/services/metrics/dashboard_shared_examples.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/support/shared_examples/services/metrics/dashboard_shared_examples.rb b/spec/support/shared_examples/services/metrics/dashboard_shared_examples.rb
index c8fabfe30b9..1501a2a0f52 100644
--- a/spec/support/shared_examples/services/metrics/dashboard_shared_examples.rb
+++ b/spec/support/shared_examples/services/metrics/dashboard_shared_examples.rb
@@ -62,7 +62,7 @@ end
RSpec.shared_examples 'dashboard_version contains SHA256 hash of dashboard file content' do
specify do
dashboard = File.read(Rails.root.join(dashboard_path))
- expect(Digest::SHA256.hexdigest(dashboard)).to eq(dashboard_version)
+ expect(dashboard_version).to eq(Digest::SHA256.hexdigest(dashboard))
end
end
@@ -78,6 +78,12 @@ RSpec.shared_examples 'raises error for users with insufficient permissions' do
it_behaves_like 'misconfigured dashboard service response', :unauthorized
end
+
+ context 'when the user is anonymous' do
+ let(:user) { nil }
+
+ it_behaves_like 'misconfigured dashboard service response', :unauthorized
+ end
end
RSpec.shared_examples 'valid dashboard cloning process' do |dashboard_template, sequence|