diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-03 06:06:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-03 06:06:35 +0300 |
commit | eb10f226b83d20233f07596be2e2dcceecf83154 (patch) | |
tree | 240dc60ea65ef2709c63765c58a38771ea93d04c /spec | |
parent | 10d0e5693c0eed9fd9c40f4fadeda187237db6b5 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/merge_request/user_sees_merge_request_pipelines_spec.rb | 47 | ||||
-rw-r--r-- | spec/features/merge_request/user_sees_mr_with_deleted_source_branch_spec.rb | 5 |
2 files changed, 44 insertions, 8 deletions
diff --git a/spec/features/merge_request/user_sees_merge_request_pipelines_spec.rb b/spec/features/merge_request/user_sees_merge_request_pipelines_spec.rb index abf159949db..5b14450a289 100644 --- a/spec/features/merge_request/user_sees_merge_request_pipelines_spec.rb +++ b/spec/features/merge_request/user_sees_merge_request_pipelines_spec.rb @@ -8,6 +8,7 @@ describe 'Merge request > User sees pipelines triggered by merge request', :js d let(:project) { create(:project, :public, :repository) } let(:user) { project.creator } + let(:enable_mr_tabs_position_flag) { true } let(:config) do { @@ -26,6 +27,7 @@ describe 'Merge request > User sees pipelines triggered by merge request', :js d end before do + stub_feature_flags(mr_tabs_position: enable_mr_tabs_position_flag) stub_application_setting(auto_devops_enabled: false) stub_feature_flags(ci_merge_request_pipeline: true) stub_ci_pipeline_yaml_file(YAML.dump(config)) @@ -51,6 +53,7 @@ describe 'Merge request > User sees pipelines triggered by merge request', :js d Ci::CreatePipelineService.new(project, user, ref: 'feature') .execute(:merge_request_event, merge_request: merge_request) end + let(:enable_mr_tabs_position_flag) { false } before do visit project_merge_request_path(project, merge_request) @@ -67,9 +70,23 @@ describe 'Merge request > User sees pipelines triggered by merge request', :js d end end - it 'sees the latest detached merge request pipeline as the head pipeline', :sidekiq_might_not_need_inline do - page.within('.ci-widget-content') do - expect(page).to have_content("##{detached_merge_request_pipeline.id}") + context 'when merge request tabs feature flag is disabled' do + it 'sees the latest detached merge request pipeline as the head pipeline', :sidekiq_might_not_need_inline do + page.within('.ci-widget-content') do + expect(page).to have_content("##{detached_merge_request_pipeline.id}") + end + end + end + + context 'when merge request tabs feature flag is enabled' do + let(:enable_mr_tabs_position_flag) { true } + + it 'sees the latest detached merge request pipeline as the head pipeline', :sidekiq_might_not_need_inline do + click_link "Overview" + + page.within('.ci-widget-content') do + expect(page).to have_content("##{detached_merge_request_pipeline.id}") + end end end @@ -243,9 +260,23 @@ describe 'Merge request > User sees pipelines triggered by merge request', :js d end end - it 'sees the latest detached merge request pipeline as the head pipeline' do - page.within('.ci-widget-content') do - expect(page).to have_content("##{detached_merge_request_pipeline.id}") + context 'when merge request tabs feature flag is enabled' do + it 'sees the latest detached merge request pipeline as the head pipeline' do + click_link "Overview" + + page.within('.ci-widget-content') do + expect(page).to have_content("##{detached_merge_request_pipeline.id}") + end + end + end + + context 'when merge request tabs feature flag is disabled' do + let(:enable_mr_tabs_position_flag) { false } + + it 'sees the latest detached merge request pipeline as the head pipeline' do + page.within('.ci-widget-content') do + expect(page).to have_content("##{detached_merge_request_pipeline.id}") + end end end @@ -309,6 +340,8 @@ describe 'Merge request > User sees pipelines triggered by merge request', :js d end it 'sees the latest detached merge request pipeline as the head pipeline' do + click_link "Overview" + page.within('.ci-widget-content') do expect(page).to have_content("##{detached_merge_request_pipeline_2.id}") end @@ -323,6 +356,8 @@ describe 'Merge request > User sees pipelines triggered by merge request', :js d context 'when a user merges a merge request from a forked project to the parent project' do before do + click_link("Overview") + click_button 'Merge when pipeline succeeds' wait_for_requests diff --git a/spec/features/merge_request/user_sees_mr_with_deleted_source_branch_spec.rb b/spec/features/merge_request/user_sees_mr_with_deleted_source_branch_spec.rb index 3d25611e1ea..e28d2ca5536 100644 --- a/spec/features/merge_request/user_sees_mr_with_deleted_source_branch_spec.rb +++ b/spec/features/merge_request/user_sees_mr_with_deleted_source_branch_spec.rb @@ -25,15 +25,16 @@ describe 'Merge request > User sees MR with deleted source branch', :js do it 'still contains Discussion, Commits and Changes tabs' do within '.merge-request-details' do - expect(page).to have_content('Discussion') + expect(page).to have_content('Overview') expect(page).to have_content('Commits') expect(page).to have_content('Changes') end + expect(page).to have_content('Source branch does not exist.') + click_on 'Changes' wait_for_requests expect(page).to have_selector('.diffs.tab-pane .file-holder') - expect(page).to have_content('Source branch does not exist.') end end |