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>2020-04-10 00:09:19 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-10 00:09:19 +0300
commit254ec28f5448f6f353cd98f637985de3d1405854 (patch)
tree1c84ed7b7dd32db96454af034cd6c7e90699e76d /spec/controllers
parent141902c04943d5fb43c014b8cf42af60a3bc0cdf (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/projects/pipelines_controller_spec.rb48
1 files changed, 36 insertions, 12 deletions
diff --git a/spec/controllers/projects/pipelines_controller_spec.rb b/spec/controllers/projects/pipelines_controller_spec.rb
index d9345cfaced..9d243bf5a7f 100644
--- a/spec/controllers/projects/pipelines_controller_spec.rb
+++ b/spec/controllers/projects/pipelines_controller_spec.rb
@@ -789,25 +789,49 @@ describe Projects::PipelinesController do
end
end
- context 'when test_report contains attachment and scope is with_attachment as a URL param' do
- let(:pipeline) { create(:ci_pipeline, :with_test_reports_attachment, project: project) }
+ context 'when junit_pipeline_screenshots_view is enabled' do
+ before do
+ stub_feature_flags(junit_pipeline_screenshots_view: { enabled: true, thing: project })
+ end
- it 'returns a test reports with attachment' do
- get_test_report_json(scope: 'with_attachment')
+ context 'when test_report contains attachment and scope is with_attachment as a URL param' do
+ let(:pipeline) { create(:ci_pipeline, :with_test_reports_attachment, project: project) }
- expect(response).to have_gitlab_http_status(:ok)
- expect(json_response["test_suites"]).to be_present
+ it 'returns a test reports with attachment' do
+ get_test_report_json(scope: 'with_attachment')
+
+ expect(response).to have_gitlab_http_status(:ok)
+ expect(json_response["test_suites"]).to be_present
+ expect(json_response["test_suites"].first["test_cases"].first).to include("attachment_url")
+ end
+ end
+
+ context 'when test_report does not contain attachment and scope is with_attachment as a URL param' do
+ let(:pipeline) { create(:ci_pipeline, :with_test_reports, project: project) }
+
+ it 'returns a test reports with empty values' do
+ get_test_report_json(scope: 'with_attachment')
+
+ expect(response).to have_gitlab_http_status(:ok)
+ expect(json_response["test_suites"]).to be_empty
+ end
end
end
- context 'when test_report does not contain attachment and scope is with_attachment as a URL param' do
- let(:pipeline) { create(:ci_pipeline, :with_test_reports, project: project) }
+ context 'when junit_pipeline_screenshots_view is disabled' do
+ before do
+ stub_feature_flags(junit_pipeline_screenshots_view: { enabled: false, thing: project })
+ end
- it 'returns a test reports with empty values' do
- get_test_report_json(scope: 'with_attachment')
+ context 'when test_report contains attachment and scope is with_attachment as a URL param' do
+ let(:pipeline) { create(:ci_pipeline, :with_test_reports_attachment, project: project) }
- expect(response).to have_gitlab_http_status(:ok)
- expect(json_response["test_suites"]).to be_empty
+ it 'returns a test reports without attachment_url' do
+ get_test_report_json(scope: 'with_attachment')
+
+ expect(response).to have_gitlab_http_status(:ok)
+ expect(json_response["test_suites"].first["test_cases"].first).not_to include("attachment_url")
+ end
end
end
end