diff options
Diffstat (limited to 'spec/features/merge_requests/widget_spec.rb')
-rw-r--r-- | spec/features/merge_requests/widget_spec.rb | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/spec/features/merge_requests/widget_spec.rb b/spec/features/merge_requests/widget_spec.rb index 3ac1f603de6..69e31c7481f 100644 --- a/spec/features/merge_requests/widget_spec.rb +++ b/spec/features/merge_requests/widget_spec.rb @@ -1,27 +1,25 @@ require 'rails_helper' -describe 'Merge request', :feature, :js do +describe 'Merge request', :js do let(:user) { create(:user) } - let(:project) { create(:project) } + let(:project) { create(:project, :repository) } let(:merge_request) { create(:merge_request, source_project: project) } before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) end context 'new merge request' do before do - visit new_namespace_project_merge_request_path( - project.namespace, + visit project_new_merge_request_path( project, merge_request: { source_project_id: project.id, target_project_id: project.id, source_branch: 'feature', target_branch: 'master' - } - ) + }) end it 'shows widget status after creating new merge request' do @@ -44,7 +42,7 @@ describe 'Merge request', :feature, :js do end before do - visit namespace_project_merge_request_path(project.namespace, project, merge_request) + visit project_merge_request_path(project, merge_request) end it 'shows environments link' do @@ -71,7 +69,7 @@ describe 'Merge request', :feature, :js do type: 'CiService', category: 'ci') - visit namespace_project_merge_request_path(project.namespace, project, merge_request) + visit project_merge_request_path(project, merge_request) end it 'has danger button while waiting for external CI status' do @@ -92,7 +90,7 @@ describe 'Merge request', :feature, :js do head_pipeline_of: merge_request) create(:ci_build, :pending, pipeline: pipeline) - visit namespace_project_merge_request_path(project.namespace, project, merge_request) + visit project_merge_request_path(project, merge_request) end it 'has danger button when not succeeded' do @@ -112,9 +110,7 @@ describe 'Merge request', :feature, :js do status: :manual, head_pipeline_of: merge_request) - visit namespace_project_merge_request_path(project.namespace, - project, - merge_request) + visit project_merge_request_path(project, merge_request) end it 'shows information about blocked pipeline' do @@ -136,7 +132,7 @@ describe 'Merge request', :feature, :js do head_pipeline_of: merge_request) create(:ci_build, :pending, pipeline: pipeline) - visit namespace_project_merge_request_path(project.namespace, project, merge_request) + visit project_merge_request_path(project, merge_request) end it 'has info button when MWBS button' do @@ -154,7 +150,7 @@ describe 'Merge request', :feature, :js do merge_error: 'Something went wrong' ) - visit namespace_project_merge_request_path(project.namespace, project, merge_request) + visit project_merge_request_path(project, merge_request) end it 'shows information about the merge error' do @@ -175,7 +171,7 @@ describe 'Merge request', :feature, :js do merge_error: 'Something went wrong' ) - visit namespace_project_merge_request_path(project.namespace, project, merge_request) + visit project_merge_request_path(project, merge_request) end it 'shows information about the merge error' do @@ -191,7 +187,7 @@ describe 'Merge request', :feature, :js do context 'merge error' do before do allow_any_instance_of(Repository).to receive(:merge).and_return(false) - visit namespace_project_merge_request_path(project.namespace, project, merge_request) + visit project_merge_request_path(project, merge_request) end it 'updates the MR widget' do @@ -204,15 +200,15 @@ describe 'Merge request', :feature, :js do end context 'user can merge into source project but cannot push to fork', js: true do - let(:fork_project) { create(:project, :public) } + let(:fork_project) { create(:project, :public, :repository) } let(:user2) { create(:user) } before do project.team << [user2, :master] - gitlab_sign_out - gitlab_sign_in user2 + sign_out(:user) + sign_in(user2) merge_request.update(target_project: fork_project) - visit namespace_project_merge_request_path(project.namespace, project, merge_request) + visit project_merge_request_path(project, merge_request) end it 'user can merge into the source project' do |