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
fa7b4eca
Commit
fa7b4eca
authored
Dec 13, 2018
by
Brett Walker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use proper API::Entities::Milestone
parent
b5dbfbba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
7 deletions
+26
-7
app/serializers/issue_board_entity.rb
app/serializers/issue_board_entity.rb
+1
-1
spec/serializers/issue_board_entity_spec.rb
spec/serializers/issue_board_entity_spec.rb
+25
-6
No files found.
app/serializers/issue_board_entity.rb
View file @
fa7b4eca
...
...
@@ -17,7 +17,7 @@ class IssueBoardEntity < Grape::Entity
end
expose
:milestone
,
expose_nil:
false
do
|
issue
|
API
::
Entities
::
Project
.
represent
issue
.
milestone
,
only:
[
:id
,
:title
]
API
::
Entities
::
Milestone
.
represent
issue
.
milestone
,
only:
[
:id
,
:title
]
end
expose
:assignees
do
|
issue
|
...
...
spec/serializers/issue_board_entity_spec.rb
View file @
fa7b4eca
...
...
@@ -3,21 +3,40 @@
require
'spec_helper'
describe
IssueBoardEntity
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:resource
)
{
create
(
:issue
,
project:
project
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:request
)
{
double
(
'request'
,
current_user:
user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:resource
)
{
create
(
:issue
,
project:
project
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
let
(
:label
)
{
create
(
:label
,
project:
project
,
title:
'Test Label'
)
}
let
(
:request
)
{
double
(
'request'
,
current_user:
user
)
}
subject
{
described_class
.
new
(
resource
,
request:
request
).
as_json
}
it
'has basic attributes'
do
expect
(
subject
).
to
include
(
:id
,
:iid
,
:title
,
:confidential
,
:due_date
,
:project_id
,
:relative_position
,
:
project
,
:labels
)
:
labels
,
:assignees
,
project:
hash_including
(
:id
,
:path
)
)
end
it
'has path and endpoints'
do
expect
(
subject
).
to
include
(
:reference_path
,
:real_path
,
:issue_sidebar_endpoint
,
:toggle_subscription_endpoint
,
:assignable_labels_endpoint
)
end
it
'has milestone attributes'
do
resource
.
milestone
=
milestone
expect
(
subject
).
to
include
(
milestone:
hash_including
(
:id
,
:title
))
end
it
'has assignee attributes'
do
resource
.
assignees
=
[
user
]
expect
(
subject
).
to
include
(
assignees:
array_including
(
hash_including
(
:id
,
:name
,
:username
,
:avatar_url
)))
end
it
'has label attributes'
do
resource
.
labels
=
[
label
]
expect
(
subject
).
to
include
(
labels:
array_including
(
hash_including
(
:id
,
:title
,
:color
,
:description
,
:text_color
,
:priority
)))
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