Commit 58a10110 authored by Imre Farkas's avatar Imre Farkas

Merge branch 'mo-rename-test-case-factory' into 'master'

Rename test case factory

See merge request gitlab-org/gitlab!30178
parents 894ec095 6a864d3a
...@@ -16,7 +16,7 @@ FactoryBot.define do ...@@ -16,7 +16,7 @@ FactoryBot.define do
system_output { "Failure/Error: is_expected.to eq(300) expected: 300 got: -100" } system_output { "Failure/Error: is_expected.to eq(300) expected: 300 got: -100" }
end end
trait :with_attachment do trait :failed_with_attachment do
status { Gitlab::Ci::Reports::TestCase::STATUS_FAILED } status { Gitlab::Ci::Reports::TestCase::STATUS_FAILED }
attachment { "some/path.png" } attachment { "some/path.png" }
end end
......
...@@ -62,7 +62,7 @@ describe Gitlab::Ci::Reports::TestCase do ...@@ -62,7 +62,7 @@ describe Gitlab::Ci::Reports::TestCase do
end end
context 'when attachment is present' do context 'when attachment is present' do
let(:attachment_test_case) { build(:test_case, :with_attachment) } let(:attachment_test_case) { build(:test_case, :failed_with_attachment) }
it "initializes the attachment if present" do it "initializes the attachment if present" do
expect(attachment_test_case.attachment).to eq("some/path.png") expect(attachment_test_case.attachment).to eq("some/path.png")
......
...@@ -127,7 +127,7 @@ describe Gitlab::Ci::Reports::TestReports do ...@@ -127,7 +127,7 @@ describe Gitlab::Ci::Reports::TestReports do
context 'when test suites contain an attachment' do context 'when test suites contain an attachment' do
let(:test_case_succes) { build(:test_case) } let(:test_case_succes) { build(:test_case) }
let(:test_case_with_attachment) { build(:test_case, :with_attachment) } let(:test_case_with_attachment) { build(:test_case, :failed_with_attachment) }
before do before do
test_reports.get_suite('rspec').add_test_case(test_case_succes) test_reports.get_suite('rspec').add_test_case(test_case_succes)
......
...@@ -101,7 +101,7 @@ describe Gitlab::Ci::Reports::TestSuite do ...@@ -101,7 +101,7 @@ describe Gitlab::Ci::Reports::TestSuite do
end end
context 'when test cases contain an attachment' do context 'when test cases contain an attachment' do
let(:test_case_with_attachment) { build(:test_case, :with_attachment)} let(:test_case_with_attachment) { build(:test_case, :failed_with_attachment)}
before do before do
test_suite.add_test_case(test_case_with_attachment) test_suite.add_test_case(test_case_with_attachment)
......
...@@ -38,7 +38,7 @@ describe TestCaseEntity do ...@@ -38,7 +38,7 @@ describe TestCaseEntity do
end end
context 'when attachment is present' do context 'when attachment is present' do
let(:test_case) { build(:test_case, :with_attachment) } let(:test_case) { build(:test_case, :failed_with_attachment) }
it 'returns the attachment_url' do it 'returns the attachment_url' do
expect(subject).to include(:attachment_url) expect(subject).to include(:attachment_url)
...@@ -60,7 +60,7 @@ describe TestCaseEntity do ...@@ -60,7 +60,7 @@ describe TestCaseEntity do
end end
context 'when attachment is present' do context 'when attachment is present' do
let(:test_case) { build(:test_case, :with_attachment) } let(:test_case) { build(:test_case, :failed_with_attachment) }
it 'returns no attachment_url' do it 'returns no attachment_url' do
expect(subject).not_to include(:attachment_url) expect(subject).not_to include(:attachment_url)
......
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