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
fa0d0bf2
Commit
fa0d0bf2
authored
Sep 26, 2017
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow assignee, author and weight on EE board creation action
parent
d80dd3b5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
5 deletions
+23
-5
ee/app/controllers/ee/boards/boards_controller.rb
ee/app/controllers/ee/boards/boards_controller.rb
+1
-1
spec/ee/spec/controllers/projects/boards_controller_spec.rb
spec/ee/spec/controllers/projects/boards_controller_spec.rb
+22
-4
No files found.
ee/app/controllers/ee/boards/boards_controller.rb
View file @
fa0d0bf2
...
@@ -55,7 +55,7 @@ module EE
...
@@ -55,7 +55,7 @@ module EE
end
end
def
board_params
def
board_params
params
.
require
(
:board
).
permit
(
:name
,
:
mileston
e_id
)
params
.
require
(
:board
).
permit
(
:name
,
:
weight
,
:milestone_id
,
:author_id
,
:assigne
e_id
)
end
end
def
find_board
def
find_board
...
...
spec/ee/spec/controllers/projects/boards_controller_spec.rb
View file @
fa0d0bf2
...
@@ -36,17 +36,35 @@ describe Projects::BoardsController do
...
@@ -36,17 +36,35 @@ describe Projects::BoardsController do
end
end
context
'with valid params'
do
context
'with valid params'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:milestone
)
{
create
(
:milestone
)
}
let
(
:valid_params
)
do
{
name:
'Backend'
,
weight:
1
,
milestone_id:
milestone
.
id
,
author_id:
user
.
id
,
assignee_id:
user
.
id
}
end
it
'returns a successful 200 response'
do
it
'returns a successful 200 response'
do
create_board
name:
'Backend'
create_board
valid_params
expect
(
response
).
to
have_http_status
(
200
)
expect
(
response
).
to
have_http_status
(
200
)
end
end
it
'returns the created board'
do
it
'returns the created board'
do
create_board
name:
'Backend'
create_board
valid_params
expect
(
response
).
to
match_response_schema
(
'board'
)
expect
(
response
).
to
match_response_schema
(
'board'
)
end
end
it
'valid board is created'
do
create_board
valid_params
expect
(
Board
.
count
).
to
eq
(
1
)
expect
(
Board
.
first
).
to
have_attributes
(
valid_params
)
end
end
end
context
'with invalid params'
do
context
'with invalid params'
do
...
@@ -80,10 +98,10 @@ describe Projects::BoardsController do
...
@@ -80,10 +98,10 @@ describe Projects::BoardsController do
expect
(
response
).
to
have_http_status
(
404
)
expect
(
response
).
to
have_http_status
(
404
)
end
end
def
create_board
(
name
:
)
def
create_board
(
board_params
)
post
:create
,
namespace_id:
project
.
namespace
.
to_param
,
post
:create
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
,
project_id:
project
.
to_param
,
board:
{
name:
name
}
,
board:
board_params
,
format: :json
format: :json
end
end
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