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:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-05-19 10:33:21 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-05-19 10:33:21 +0300
commit36a59d088eca61b834191dacea009677a96c052f (patch)
treee4f33972dab5d8ef79e3944a9f403035fceea43f /spec/controllers/projects/pipelines_controller_spec.rb
parenta1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff)
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'spec/controllers/projects/pipelines_controller_spec.rb')
-rw-r--r--spec/controllers/projects/pipelines_controller_spec.rb76
1 files changed, 76 insertions, 0 deletions
diff --git a/spec/controllers/projects/pipelines_controller_spec.rb b/spec/controllers/projects/pipelines_controller_spec.rb
index 8fae82d54a2..1be4177acd1 100644
--- a/spec/controllers/projects/pipelines_controller_spec.rb
+++ b/spec/controllers/projects/pipelines_controller_spec.rb
@@ -19,6 +19,27 @@ RSpec.describe Projects::PipelinesController do
sign_in(user)
end
+ shared_examples 'the show page' do |param|
+ it 'redirects to pipeline path with param' do
+ get param, params: { namespace_id: project.namespace, project_id: project, id: pipeline }
+
+ expect(response).to redirect_to(pipeline_path(pipeline, tab: param))
+ end
+
+ context 'when the FF pipeline_tabs_vue is disabled' do
+ before do
+ stub_feature_flags(pipeline_tabs_vue: false)
+ end
+
+ it 'renders the show template' do
+ get param, params: { namespace_id: project.namespace, project_id: project, id: pipeline }
+
+ expect(response).to have_gitlab_http_status(:ok)
+ expect(response).to render_template :show
+ end
+ end
+ end
+
describe 'GET index.json' do
before do
create_all_pipeline_types
@@ -625,6 +646,12 @@ RSpec.describe Projects::PipelinesController do
end
end
+ describe 'GET dag' do
+ let(:pipeline) { create(:ci_pipeline, project: project) }
+
+ it_behaves_like 'the show page', 'dag'
+ end
+
describe 'GET dag.json' do
let(:pipeline) { create(:ci_pipeline, project: project) }
@@ -658,6 +685,49 @@ RSpec.describe Projects::PipelinesController do
end
end
+ describe 'GET builds' do
+ let(:pipeline) { create(:ci_pipeline, project: project) }
+
+ it_behaves_like 'the show page', 'builds'
+ end
+
+ describe 'GET failures' do
+ let(:pipeline) { create(:ci_pipeline, project: project) }
+
+ context 'with ff `pipeline_tabs_vue` disabled' do
+ before do
+ stub_feature_flags(pipeline_tabs_vue: false)
+ end
+
+ context 'with failed jobs' do
+ before do
+ create(:ci_build, :failed, pipeline: pipeline, name: 'hello')
+ end
+
+ it 'shows the page' do
+ get :failures, params: { namespace_id: project.namespace, project_id: project, id: pipeline }
+
+ expect(response).to have_gitlab_http_status(:ok)
+ expect(response).to render_template :show
+ end
+ end
+
+ context 'without failed jobs' do
+ it 'redirects to the main pipeline page' do
+ get :failures, params: { namespace_id: project.namespace, project_id: project, id: pipeline }
+
+ expect(response).to redirect_to(pipeline_path(pipeline))
+ end
+ end
+ end
+
+ it 'redirects to the pipeline page with `failures` query param' do
+ get :failures, params: { namespace_id: project.namespace, project_id: project, id: pipeline }
+
+ expect(response).to redirect_to(pipeline_path(pipeline, tab: 'failures'))
+ end
+ end
+
describe 'GET stages.json' do
let(:pipeline) { create(:ci_pipeline, project: project) }
@@ -988,6 +1058,12 @@ RSpec.describe Projects::PipelinesController do
end
end
+ describe 'GET test_report' do
+ let(:pipeline) { create(:ci_pipeline, project: project) }
+
+ it_behaves_like 'the show page', 'test_report'
+ end
+
describe 'GET test_report.json' do
let(:pipeline) { create(:ci_pipeline, project: project) }