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
Léo-Paul Géneau
gitlab-ce
Commits
68f30b2f
Commit
68f30b2f
authored
8 years ago
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support to group labels on issues board API
parent
bf710b51
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
10 deletions
+19
-10
lib/api/boards.rb
lib/api/boards.rb
+2
-2
spec/requests/api/boards_spec.rb
spec/requests/api/boards_spec.rb
+17
-8
No files found.
lib/api/boards.rb
View file @
68f30b2f
...
...
@@ -65,8 +65,8 @@ module API
requires
:label_id
,
type:
Integer
,
desc:
'The ID of an existing label'
end
post
'/lists'
do
unless
user_project
.
labels
.
exists?
(
params
[
:label_id
])
render_api_error!
({
error:
"Label not found!"
},
400
)
unless
available_
labels
.
exists?
(
params
[
:label_id
])
render_api_error!
({
error:
'Label not found!'
},
400
)
end
authorize!
(
:admin_list
,
user_project
)
...
...
This diff is collapsed.
Click to expand it.
spec/requests/api/boards_spec.rb
View file @
68f30b2f
...
...
@@ -106,9 +106,20 @@ describe API::API, api: true do
describe
"POST /projects/:id/board/lists"
do
let
(
:base_url
)
{
"/projects/
#{
project
.
id
}
/boards/
#{
board
.
id
}
/lists"
}
it
'creates a new issue board list'
do
post
api
(
base_url
,
user
),
label_id:
ux_label
.
id
it
'creates a new issue board list for group labels'
do
group
=
create
(
:group
)
group_label
=
create
(
:group_label
,
group:
group
)
project
.
update
(
group:
group
)
post
api
(
base_url
,
user
),
label_id:
group_label
.
id
expect
(
response
).
to
have_http_status
(
201
)
expect
(
json_response
[
'label'
][
'name'
]).
to
eq
(
group_label
.
title
)
expect
(
json_response
[
'position'
]).
to
eq
(
3
)
end
it
'creates a new issue board list for project labels'
do
post
api
(
base_url
,
user
),
label_id:
ux_label
.
id
expect
(
response
).
to
have_http_status
(
201
)
expect
(
json_response
[
'label'
][
'name'
]).
to
eq
(
ux_label
.
title
)
...
...
@@ -116,15 +127,13 @@ describe API::API, api: true do
end
it
'returns 400 when creating a new list if label_id is invalid'
do
post
api
(
base_url
,
user
),
label_id:
23423
post
api
(
base_url
,
user
),
label_id:
23423
expect
(
response
).
to
have_http_status
(
400
)
end
it
"returns 403 for project members with guest role"
do
put
api
(
"
#{
base_url
}
/
#{
test_list
.
id
}
"
,
guest
),
position:
1
it
'returns 403 for project members with guest role'
do
put
api
(
"
#{
base_url
}
/
#{
test_list
.
id
}
"
,
guest
),
position:
1
expect
(
response
).
to
have_http_status
(
403
)
end
...
...
This diff is collapsed.
Click to expand it.
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