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
f1143c83
Commit
f1143c83
authored
Apr 01, 2021
by
Jose Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test scenario for the jobs_resolver_spec
parent
29291f79
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
app/graphql/types/ci/job_type.rb
app/graphql/types/ci/job_type.rb
+1
-1
spec/graphql/resolvers/ci/jobs_resolver_spec.rb
spec/graphql/resolvers/ci/jobs_resolver_spec.rb
+16
-1
No files found.
app/graphql/types/ci/job_type.rb
View file @
f1143c83
...
...
@@ -71,7 +71,7 @@ module Types
end
def
tags
object
.
tags
.
map
{
|
tag
|
tag
.
name
}
if
object
.
is_a?
(
::
Ci
::
Build
)
object
.
tags
.
map
(
&
:name
)
if
object
.
is_a?
(
::
Ci
::
Build
)
end
def
detailed_status
...
...
spec/graphql/resolvers/ci/jobs_resolver_spec.rb
View file @
f1143c83
...
...
@@ -13,6 +13,7 @@ RSpec.describe Resolvers::Ci::JobsResolver do
create
(
:ci_build
,
:sast
,
name:
'DAST job'
,
pipeline:
pipeline
)
create
(
:ci_build
,
:dast
,
name:
'SAST job'
,
pipeline:
pipeline
)
create
(
:ci_build
,
:container_scanning
,
name:
'Container scanning job'
,
pipeline:
pipeline
)
create
(
:ci_build
,
name:
'Job with tags'
,
pipeline:
pipeline
,
tag_list:
[
'review'
])
end
describe
'#resolve'
do
...
...
@@ -24,7 +25,8 @@ RSpec.describe Resolvers::Ci::JobsResolver do
have_attributes
(
name:
'Normal job'
),
have_attributes
(
name:
'DAST job'
),
have_attributes
(
name:
'SAST job'
),
have_attributes
(
name:
'Container scanning job'
)
have_attributes
(
name:
'Container scanning job'
),
have_attributes
(
name:
'Job with tags'
)
)
end
end
...
...
@@ -43,5 +45,18 @@ RSpec.describe Resolvers::Ci::JobsResolver do
)
end
end
context
'when a job has tags'
do
it
"returns jobs with tags when applicable"
do
jobs
=
resolve
(
described_class
,
obj:
pipeline
)
expect
(
jobs
).
to
contain_exactly
(
have_attributes
(
tag_list:
[]),
have_attributes
(
tag_list:
[]),
have_attributes
(
tag_list:
[]),
have_attributes
(
tag_list:
[]),
have_attributes
(
tag_list:
[
'review'
])
)
end
end
end
end
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