Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ee61b10a
Commit
ee61b10a
authored
Aug 27, 2020
by
Heinrich Lee Yu
Committed by
Eugenia Grieff
Sep 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix test case entity spec
This spec needs a persisted job because the job_id is used for some fields
parent
3206fa5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
spec/serializers/test_case_entity_spec.rb
spec/serializers/test_case_entity_spec.rb
+6
-4
No files found.
spec/serializers/test_case_entity_spec.rb
View file @
ee61b10a
...
...
@@ -5,6 +5,8 @@ require 'spec_helper'
RSpec
.
describe
TestCaseEntity
do
include
TestReportsHelper
let_it_be
(
:job
)
{
create
(
:ci_build
)
}
let
(
:entity
)
{
described_class
.
new
(
test_case
)
}
describe
'#as_json'
do
...
...
@@ -38,7 +40,7 @@ RSpec.describe TestCaseEntity do
end
context
'when attachment is present'
do
let
(
:test_case
)
{
build
(
:test_case
,
:failed_with_attachment
)
}
let
(
:test_case
)
{
build
(
:test_case
,
:failed_with_attachment
,
job:
job
)
}
it
'returns the attachment_url'
do
expect
(
subject
).
to
include
(
:attachment_url
)
...
...
@@ -46,7 +48,7 @@ RSpec.describe TestCaseEntity do
end
context
'when attachment is not present'
do
let
(
:test_case
)
{
build
(
:test_case
)
}
let
(
:test_case
)
{
build
(
:test_case
,
job:
job
)
}
it
'returns a nil attachment_url'
do
expect
(
subject
[
:attachment_url
]).
to
be_nil
...
...
@@ -60,7 +62,7 @@ RSpec.describe TestCaseEntity do
end
context
'when attachment is present'
do
let
(
:test_case
)
{
build
(
:test_case
,
:failed_with_attachment
)
}
let
(
:test_case
)
{
build
(
:test_case
,
:failed_with_attachment
,
job:
job
)
}
it
'returns no attachment_url'
do
expect
(
subject
).
not_to
include
(
:attachment_url
)
...
...
@@ -68,7 +70,7 @@ RSpec.describe TestCaseEntity do
end
context
'when attachment is not present'
do
let
(
:test_case
)
{
build
(
:test_case
)
}
let
(
:test_case
)
{
build
(
:test_case
,
job:
job
)
}
it
'returns no attachment_url'
do
expect
(
subject
).
not_to
include
(
:attachment_url
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment