diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-10 18:13:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-10 18:13:21 +0300 |
commit | 26881dd926cfac47c9603d44e8d5a504ab8c4a14 (patch) | |
tree | 32d0543691630448b1b2a624bdae41ead6bcc7fc /spec/serializers | |
parent | 419966e5d34a98d89354ed658c33478ce02d8017 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/serializers')
-rw-r--r-- | spec/serializers/merge_request_widget_entity_spec.rb | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/spec/serializers/merge_request_widget_entity_spec.rb b/spec/serializers/merge_request_widget_entity_spec.rb index fcfdbfc0967..3e0c61a26c0 100644 --- a/spec/serializers/merge_request_widget_entity_spec.rb +++ b/spec/serializers/merge_request_widget_entity_spec.rb @@ -4,6 +4,7 @@ require 'spec_helper' RSpec.describe MergeRequestWidgetEntity do include ProjectForksHelper + include Gitlab::Routing.url_helpers let(:project) { create :project, :repository } let(:resource) { create(:merge_request, source_project: project, target_project: project) } @@ -140,17 +141,15 @@ RSpec.describe MergeRequestWidgetEntity do let(:role) { :developer } it 'has add ci config path' do - expected_path = "/#{resource.project.full_path}/-/new/#{resource.source_branch}" + expected_path = project_ci_pipeline_editor_path(project) expect(subject[:merge_request_add_ci_config_path]).to include(expected_path) end it 'has expected params' do expected_params = { - commit_message: 'Add .gitlab-ci.yml', - file_name: '.gitlab-ci.yml', - suggest_gitlab_ci_yml: 'true', - mr_path: "/#{resource.project.full_path}/-/merge_requests/#{resource.iid}" + branch_name: resource.source_branch, + add_new_config_file: 'true' }.with_indifferent_access uri = Addressable::URI.parse(subject[:merge_request_add_ci_config_path]) @@ -188,30 +187,6 @@ RSpec.describe MergeRequestWidgetEntity do end end - context 'when ci_config_path is customized' do - it 'has no path if ci_config_path is not set to our default setting' do - project.ci_config_path = 'not_default' - - expect(subject[:merge_request_add_ci_config_path]).to be_nil - end - - it 'has a path if ci_config_path unset' do - expect(subject[:merge_request_add_ci_config_path]).not_to be_nil - end - - it 'has a path if ci_config_path is an empty string' do - project.ci_config_path = '' - - expect(subject[:merge_request_add_ci_config_path]).not_to be_nil - end - - it 'has a path if ci_config_path is set to our default file' do - project.ci_config_path = Gitlab::FileDetector::PATTERNS[:gitlab_ci] - - expect(subject[:merge_request_add_ci_config_path]).not_to be_nil - end - end - context 'when build feature is disabled' do before do project.project_feature.update!(builds_access_level: ProjectFeature::DISABLED) |