Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/projects/pipelines/pipeline_spec.rb')
-rw-r--r--spec/features/projects/pipelines/pipeline_spec.rb52
1 files changed, 44 insertions, 8 deletions
diff --git a/spec/features/projects/pipelines/pipeline_spec.rb b/spec/features/projects/pipelines/pipeline_spec.rb
index 0b43e13996f..2d729af513a 100644
--- a/spec/features/projects/pipelines/pipeline_spec.rb
+++ b/spec/features/projects/pipelines/pipeline_spec.rb
@@ -64,7 +64,9 @@ RSpec.describe 'Pipeline', :js do
let_it_be(:group) { create(:group) }
let_it_be(:project, reload: true) { create(:project, :repository, group: group) }
- let(:pipeline) { create(:ci_pipeline, project: project, ref: 'master', sha: project.commit.id, user: user) }
+ let(:pipeline) do
+ create(:ci_pipeline, name: 'Build pipeline', project: project, ref: 'master', sha: project.commit.id, user: user)
+ end
subject(:visit_pipeline) { visit project_pipeline_path(project, pipeline) }
@@ -96,6 +98,45 @@ RSpec.describe 'Pipeline', :js do
end
end
+ context 'with pipeline_name feature flag enabled' do
+ before do
+ stub_feature_flags(pipeline_name: true)
+ end
+
+ it 'displays pipeline name instead of commit title' do
+ visit_pipeline
+
+ within 'h3' do
+ expect(page).to have_content(pipeline.name)
+ end
+
+ within '.well-segment[data-testid="commit-row"]' do
+ expect(page).to have_content(project.commit.title)
+ expect(page).to have_content(project.commit.short_id)
+ end
+ end
+ end
+
+ context 'with pipeline_name feature flag disabled' do
+ before do
+ stub_feature_flags(pipeline_name: false)
+ end
+
+ it 'displays commit title' do
+ visit_pipeline
+
+ within 'h3' do
+ expect(page).not_to have_content(pipeline.name)
+ expect(page).to have_content(project.commit.title)
+ end
+
+ within '.well-segment[data-testid="commit-row"]' do
+ expect(page).not_to have_content(project.commit.title)
+ expect(page).to have_content(project.commit.short_id)
+ end
+ end
+ end
+
describe 'related merge requests' do
context 'when there are no related merge requests' do
it 'shows a "no related merge requests" message' do
@@ -363,7 +404,7 @@ RSpec.describe 'Pipeline', :js do
project: downstream_project,
ref: 'master',
sha: downstream_project.commit.id,
- child_of: pipeline )
+ child_of: pipeline)
end
let!(:build) { create(:ci_build, status, pipeline: downstream_pipeline, user: user) }
@@ -851,12 +892,7 @@ RSpec.describe 'Pipeline', :js do
before do
schedule.owner.block!
-
- begin
- PipelineScheduleWorker.new.perform
- rescue Ci::CreatePipelineService::CreateError
- # Do nothing, assert view code after the Pipeline failed to create.
- end
+ PipelineScheduleWorker.new.perform
end
it 'displays the PipelineSchedule in an inactive state' do