diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-26 18:08:56 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-26 18:08:56 +0300 |
commit | 17ab40ca089e1aef61a83f77ab6df62a72f6ce06 (patch) | |
tree | 8eb149293eee90ec2750b6ac5e46a111a806424e /spec/support/shared_examples/services | |
parent | 66d4203791a01fdedf668a78818a229ea2c07aad (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/shared_examples/services')
-rw-r--r-- | spec/support/shared_examples/services/metrics/dashboard_shared_examples.rb | 21 |
1 files changed, 21 insertions, 0 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 1f229d6b783..a4f81097ffa 100644 --- a/spec/support/shared_examples/services/metrics/dashboard_shared_examples.rb +++ b/spec/support/shared_examples/services/metrics/dashboard_shared_examples.rb @@ -85,3 +85,24 @@ RSpec.shared_examples 'valid dashboard cloning process' do |dashboard_template, end end end + +RSpec.shared_examples 'valid dashboard update process' do + let(:dashboard_attrs) do + { + commit_message: commit_message, + branch_name: branch, + start_branch: project.default_branch, + encoding: 'text', + file_path: ".gitlab/dashboards/#{file_name}", + file_content: ::PerformanceMonitoring::PrometheusDashboard.from_json(file_content_hash).to_yaml + } + end + + it 'delegates commit creation to Files::UpdateService', :aggregate_failures do + service_instance = instance_double(::Files::UpdateService) + expect(::Files::UpdateService).to receive(:new).with(project, user, dashboard_attrs).and_return(service_instance) + expect(service_instance).to receive(:execute).and_return(status: :success) + + service_call + end +end |