diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
commit | a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch) | |
tree | fb69158581673816a8cd895f9d352dcb3c678b1e /spec/lib/gitlab/ci/parsers/test/junit_spec.rb | |
parent | d16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff) |
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'spec/lib/gitlab/ci/parsers/test/junit_spec.rb')
-rw-r--r-- | spec/lib/gitlab/ci/parsers/test/junit_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/parsers/test/junit_spec.rb b/spec/lib/gitlab/ci/parsers/test/junit_spec.rb index 7da602251a5..4ca8f74e57f 100644 --- a/spec/lib/gitlab/ci/parsers/test/junit_spec.rb +++ b/spec/lib/gitlab/ci/parsers/test/junit_spec.rb @@ -417,6 +417,30 @@ RSpec.describe Gitlab::Ci::Parsers::Test::Junit do end end + context 'when attachment is specified in test case with error' do + let(:junit) do + <<~EOF + <testsuites> + <testsuite> + <testcase classname='Calculator' name='sumTest1' time='0.01'> + <error>Some error</error> + <system-out>[[ATTACHMENT|some/path.png]]</system-out> + </testcase> + </testsuite> + </testsuites> + EOF + end + + it 'assigns correct attributes to the test case' do + expect { subject }.not_to raise_error + + expect(test_cases[0].has_attachment?).to be_truthy + expect(test_cases[0].attachment).to eq("some/path.png") + + expect(test_cases[0].job).to eq(job) + end + end + private def flattened_test_cases(test_suite) |