diff options
Diffstat (limited to 'spec/features/merge_request/user_sees_merge_request_pipelines_spec.rb')
-rw-r--r-- | spec/features/merge_request/user_sees_merge_request_pipelines_spec.rb | 51 |
1 files changed, 15 insertions, 36 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 e2aa10d80dd..7b319f6aff8 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,7 +8,6 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request', let(:project) { create(:project, :public, :repository) } let(:user) { project.creator } - let(:enable_mr_tabs_position_flag) { true } let(:config) do { @@ -27,7 +26,6 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request', 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)) @@ -36,7 +34,7 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request', end context 'when a user created a merge request in the parent project' do - let(:merge_request) do + let!(:merge_request) do create(:merge_request, source_project: project, target_project: project, @@ -53,7 +51,6 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request', 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) @@ -70,23 +67,11 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request', end end - 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" - 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 + page.within('.ci-widget-content') do + expect(page).to have_content("##{detached_merge_request_pipeline.id}") end end @@ -144,6 +129,8 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request', 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 @@ -152,6 +139,7 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request', context 'when a user merges a merge request in the parent project', :sidekiq_might_not_need_inline do before do + click_link 'Overview' click_button 'Merge when pipeline succeeds' wait_for_requests @@ -179,6 +167,7 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request', context 'when branch pipeline succeeds' do before do + click_link 'Overview' push_pipeline.succeed! wait_for_requests @@ -214,6 +203,8 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request', end it 'sees the latest branch 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("##{push_pipeline.id}") end @@ -260,23 +251,11 @@ RSpec.describe 'Merge request > User sees pipelines triggered by merge request', end end - 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" + 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 + page.within('.ci-widget-content') do + expect(page).to have_content("##{detached_merge_request_pipeline.id}") end end |