Commit a63c509a authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'rjwhitmer/gitlab-issues/JUnit-test-no-name-244891' into 'master'

Fix incorrect render in JUnit merge UI with null or blank name value

See merge request gitlab-org/gitlab!79539
parents f96949f2 2234a465
......@@ -4,7 +4,7 @@ class TestCaseEntity < Grape::Entity
include API::Helpers::RelatedResourcesHelpers
expose :status
expose :name
expose :name, default: "(No name)"
expose :classname
expose :file
expose :execution_time
......
......@@ -41,6 +41,18 @@ RSpec.describe TestCaseEntity do
end
end
context 'when no test name is entered' do
let(:test_case) { build(:report_test_case, name: "") }
it 'contains correct test case details' do
expect(subject[:status]).to eq('success')
expect(subject[:name]).to eq('(No name)')
expect(subject[:classname]).to eq('trace')
expect(subject[:file]).to eq('spec/trace_spec.rb')
expect(subject[:execution_time]).to eq(1.23)
end
end
context 'when attachment is present' do
let(:test_case) { build(:report_test_case, :failed_with_attachment, job: job) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment