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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
d549a965
Commit
d549a965
authored
Dec 21, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing specs for new pipeline related entities
[ci skip]
parent
c8b16068
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
8 deletions
+52
-8
app/serializers/pipeline_action_entity.rb
app/serializers/pipeline_action_entity.rb
+1
-1
app/serializers/pipeline_artifact_entity.rb
app/serializers/pipeline_artifact_entity.rb
+1
-1
app/serializers/status_entity.rb
app/serializers/status_entity.rb
+1
-1
spec/serializers/pipeline_action_entity_spec.rb
spec/serializers/pipeline_action_entity_spec.rb
+21
-0
spec/serializers/pipeline_artifact_entity_spec.rb
spec/serializers/pipeline_artifact_entity_spec.rb
+22
-0
spec/serializers/status_entity_spec.rb
spec/serializers/status_entity_spec.rb
+6
-5
No files found.
app/serializers/pipeline_action_entity.rb
View file @
d549a965
...
...
@@ -5,7 +5,7 @@ class PipelineActionEntity < Grape::Entity
build
.
name
.
humanize
end
expose
:
url
do
|
build
|
expose
:
path
do
|
build
|
play_namespace_project_build_path
(
build
.
project
.
namespace
,
build
.
project
,
...
...
app/serializers/pipeline_artifact_entity.rb
View file @
d549a965
...
...
@@ -5,7 +5,7 @@ class PipelineArtifactEntity < Grape::Entity
build
.
name
end
expose
:
url
do
|
build
|
expose
:
path
do
|
build
|
download_namespace_project_build_artifacts_path
(
build
.
project
.
namespace
,
build
.
project
,
...
...
app/serializers/status_entity.rb
View file @
d549a965
class
StatusEntity
<
Grape
::
Entity
include
RequestAwareEntity
expose
:icon
,
:text
,
:label
expose
:icon
,
:text
,
:label
,
:group
expose
:has_details?
,
as: :has_details
expose
:details_path
...
...
spec/serializers/pipeline_action_entity_spec.rb
0 → 100644
View file @
d549a965
require
'spec_helper'
describe
PipelineActionEntity
do
let
(
:build
)
{
create
(
:ci_build
,
name:
'test_build'
)
}
let
(
:entity
)
do
described_class
.
new
(
build
,
request:
double
)
end
describe
'#as_json'
do
subject
{
entity
.
as_json
}
it
'contains humanized build name'
do
expect
(
subject
[
:name
]).
to
eq
'Test build'
end
it
'contains path to the action play'
do
expect
(
subject
[
:path
]).
to
include
"builds/
#{
build
.
id
}
/play"
end
end
end
spec/serializers/pipeline_artifact_entity_spec.rb
0 → 100644
View file @
d549a965
require
'spec_helper'
describe
PipelineArtifactEntity
do
let
(
:build
)
{
create
(
:ci_build
,
name:
'test:build'
)
}
let
(
:entity
)
do
described_class
.
new
(
build
,
request:
double
)
end
describe
'#as_json'
do
subject
{
entity
.
as_json
}
it
'contains build name'
do
expect
(
subject
[
:name
]).
to
eq
'test:build'
end
it
'contains path to the artifacts'
do
expect
(
subject
[
:path
])
.
to
include
"builds/
#{
build
.
id
}
/artifacts/download"
end
end
end
spec/serializers/status_entity_spec.rb
View file @
d549a965
...
...
@@ -12,11 +12,12 @@ describe StatusEntity do
allow
(
status
).
to
receive
(
:details_path
).
and_return
(
'some/path'
)
end
subject
{
entity
.
as_json
}
describe
'#as_json'
do
subject
{
entity
.
as_json
}
it
'contains status details'
do
expect
(
subject
).
to
include
:text
,
:icon
,
:label
expect
(
subject
).
to
include
:has_details
e
xpect
(
subject
).
to
include
:details_path
it
'contains status details'
do
expect
(
subject
).
to
include
:text
,
:icon
,
:label
,
:group
expect
(
subject
).
to
include
:has_details
,
:details_path
e
nd
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