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
e4efb135
Commit
e4efb135
authored
Dec 07, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add status entity prototype and expose in pipeline
parent
ad19de19
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
1 deletion
+33
-1
app/serializers/pipeline_entity.rb
app/serializers/pipeline_entity.rb
+1
-1
app/serializers/status_entity.rb
app/serializers/status_entity.rb
+8
-0
spec/serializers/status_entity_spec.rb
spec/serializers/status_entity_spec.rb
+24
-0
No files found.
app/serializers/pipeline_entity.rb
View file @
e4efb135
...
@@ -12,7 +12,7 @@ class PipelineEntity < Grape::Entity
...
@@ -12,7 +12,7 @@ class PipelineEntity < Grape::Entity
end
end
expose
:details
do
expose
:details
do
expose
:
status
expose
:
detailed_status
,
as: :status
,
using:
StatusEntity
expose
:duration
expose
:duration
expose
:finished_at
expose
:finished_at
expose
:stages_with_statuses
,
as: :stages
,
using:
PipelineStageEntity
expose
:stages_with_statuses
,
as: :stages
,
using:
PipelineStageEntity
...
...
app/serializers/status_entity.rb
0 → 100644
View file @
e4efb135
class
StatusEntity
<
Grape
::
Entity
include
RequestAwareEntity
expose
:icon
,
:text
,
:label
,
:title
expose
:has_details?
,
as: :has_details
expose
:details_path
end
spec/serializers/status_entity_spec.rb
0 → 100644
View file @
e4efb135
require
'spec_helper'
describe
StatusEntity
do
let
(
:entity
)
do
described_class
.
new
(
status
)
end
let
(
:status
)
do
# TODO, add statuses factory
Gitlab
::
Ci
::
Status
::
Success
.
new
(
double
(
'object'
))
end
before
do
allow
(
status
).
to
receive
(
:has_details?
).
and_return
(
true
)
allow
(
status
).
to
receive
(
:details_path
).
and_return
(
'some/path'
)
end
subject
{
entity
.
as_json
}
it
'contains status details'
do
expect
(
subject
).
to
include
:text
,
:icon
,
:label
,
:title
expect
(
subject
).
to
include
:has_details
expect
(
subject
).
to
include
:details_path
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