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
Boxiang Sun
gitlab-ce
Commits
12800e54
Commit
12800e54
authored
Oct 14, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend API Issues, MergeRequets, Milestones with iid field
parent
ace9ff4a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
12 deletions
+16
-12
lib/api/entities.rb
lib/api/entities.rb
+13
-12
spec/requests/api/issues_spec.rb
spec/requests/api/issues_spec.rb
+1
-0
spec/requests/api/merge_requests_spec.rb
spec/requests/api/merge_requests_spec.rb
+1
-0
spec/requests/api/milestones_spec.rb
spec/requests/api/milestones_spec.rb
+1
-0
No files found.
lib/api/entities.rb
View file @
12800e54
...
@@ -91,15 +91,16 @@ module API
...
@@ -91,15 +91,16 @@ module API
expose
:expires_at
,
:updated_at
,
:created_at
expose
:expires_at
,
:updated_at
,
:created_at
end
end
class
Milestone
<
Grape
::
Entity
class
ProjectEntity
<
Grape
::
Entity
expose
:id
expose
:id
,
:iid
expose
(
:project_id
)
{
|
milestone
|
milestone
.
project
.
id
}
expose
(
:project_id
)
{
|
entity
|
entity
.
project
.
id
}
end
class
Milestone
<
ProjectEntity
expose
:title
,
:description
,
:due_date
,
:state
,
:updated_at
,
:created_at
expose
:title
,
:description
,
:due_date
,
:state
,
:updated_at
,
:created_at
end
end
class
Issue
<
Grape
::
Entity
class
Issue
<
ProjectEntity
expose
:id
expose
(
:project_id
)
{
|
issue
|
issue
.
project
.
id
}
expose
:title
,
:description
expose
:title
,
:description
expose
:label_list
,
as: :labels
expose
:label_list
,
as: :labels
expose
:milestone
,
using:
Entities
::
Milestone
expose
:milestone
,
using:
Entities
::
Milestone
...
@@ -107,14 +108,14 @@ module API
...
@@ -107,14 +108,14 @@ module API
expose
:state
,
:updated_at
,
:created_at
expose
:state
,
:updated_at
,
:created_at
end
end
class
SSHKey
<
Grape
::
Entity
class
MergeRequest
<
ProjectEntity
expose
:id
,
:title
,
:key
,
:created_at
expose
:target_branch
,
:source_branch
,
:title
,
:state
,
:upvotes
,
:downvotes
expose
:author
,
:assignee
,
using:
Entities
::
UserBasic
expose
:source_project_id
,
:target_project_id
end
end
class
MergeRequest
<
Grape
::
Entity
class
SSHKey
<
Grape
::
Entity
expose
:id
,
:target_branch
,
:source_branch
,
:title
,
:state
,
:upvotes
,
:downvotes
expose
:id
,
:title
,
:key
,
:created_at
expose
:target_project_id
,
as: :project_id
expose
:author
,
:assignee
,
using:
Entities
::
UserBasic
end
end
class
Note
<
Grape
::
Entity
class
Note
<
Grape
::
Entity
...
...
spec/requests/api/issues_spec.rb
View file @
12800e54
...
@@ -42,6 +42,7 @@ describe API::API do
...
@@ -42,6 +42,7 @@ describe API::API do
get
api
(
"/projects/
#{
project
.
id
}
/issues/
#{
issue
.
id
}
"
,
user
)
get
api
(
"/projects/
#{
project
.
id
}
/issues/
#{
issue
.
id
}
"
,
user
)
response
.
status
.
should
==
200
response
.
status
.
should
==
200
json_response
[
'title'
].
should
==
issue
.
title
json_response
[
'title'
].
should
==
issue
.
title
json_response
[
'iid'
].
should
==
issue
.
iid
end
end
it
"should return 404 if issue id not found"
do
it
"should return 404 if issue id not found"
do
...
...
spec/requests/api/merge_requests_spec.rb
View file @
12800e54
...
@@ -34,6 +34,7 @@ describe API::API do
...
@@ -34,6 +34,7 @@ describe API::API do
get
api
(
"/projects/
#{
project
.
id
}
/merge_request/
#{
merge_request
.
id
}
"
,
user
)
get
api
(
"/projects/
#{
project
.
id
}
/merge_request/
#{
merge_request
.
id
}
"
,
user
)
response
.
status
.
should
==
200
response
.
status
.
should
==
200
json_response
[
'title'
].
should
==
merge_request
.
title
json_response
[
'title'
].
should
==
merge_request
.
title
json_response
[
'iid'
].
should
==
merge_request
.
iid
end
end
it
"should return a 404 error if merge_request_id not found"
do
it
"should return a 404 error if merge_request_id not found"
do
...
...
spec/requests/api/milestones_spec.rb
View file @
12800e54
...
@@ -30,6 +30,7 @@ describe API::API do
...
@@ -30,6 +30,7 @@ describe API::API do
get
api
(
"/projects/
#{
project
.
id
}
/milestones/
#{
milestone
.
id
}
"
,
user
)
get
api
(
"/projects/
#{
project
.
id
}
/milestones/
#{
milestone
.
id
}
"
,
user
)
response
.
status
.
should
==
200
response
.
status
.
should
==
200
json_response
[
'title'
].
should
==
milestone
.
title
json_response
[
'title'
].
should
==
milestone
.
title
json_response
[
'iid'
].
should
==
milestone
.
iid
end
end
it
"should return 401 error if user not authenticated"
do
it
"should return 401 error if user not authenticated"
do
...
...
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