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
ef3eb79a
Commit
ef3eb79a
authored
Jun 30, 2017
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reject creating boards when the feature is not available
parent
e5da0e50
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
22 deletions
+37
-22
app/controllers/ee/projects/boards_controller.rb
app/controllers/ee/projects/boards_controller.rb
+1
-0
spec/controllers/ee/projects/boards_controller_spec.rb
spec/controllers/ee/projects/boards_controller_spec.rb
+36
-22
No files found.
app/controllers/ee/projects/boards_controller.rb
View file @
ef3eb79a
...
...
@@ -3,6 +3,7 @@ module EE
module
BoardsController
extend
ActiveSupport
::
Concern
prepended
do
before_action
:check_multiple_issue_boards_available!
,
only:
[
:create
]
before_action
:authorize_admin_board!
,
only:
[
:create
,
:update
,
:destroy
]
before_action
:find_board
,
only:
[
:update
,
:destroy
]
end
...
...
spec/controllers/ee/projects/boards_controller_spec.rb
View file @
ef3eb79a
...
...
@@ -30,6 +30,11 @@ describe Projects::BoardsController do # rubocop:disable RSpec/FilePath
end
describe
'POST create'
do
context
'with the multiple issue boards available'
do
before
do
stub_licensed_features
(
multiple_issue_boards:
true
)
end
context
'with valid params'
do
it
'returns a successful 200 response'
do
create_board
name:
'Backend'
...
...
@@ -65,6 +70,15 @@ describe Projects::BoardsController do # rubocop:disable RSpec/FilePath
expect
(
response
).
to
have_http_status
(
404
)
end
end
end
it
'renders a 404 when multiple issue boards are not available'
do
stub_licensed_features
(
multiple_issue_boards:
false
)
create_board
name:
'Backend'
expect
(
response
).
to
have_http_status
(
404
)
end
def
create_board
(
name
:)
post
:create
,
namespace_id:
project
.
namespace
.
to_param
,
...
...
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