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
2ec86090
Commit
2ec86090
authored
Sep 22, 2020
by
Scott Stern
Committed by
Dylan Griffith
Sep 22, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add can_update in boards_helper.rb
parent
a51c9471
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
app/helpers/boards_helper.rb
app/helpers/boards_helper.rb
+1
-0
spec/helpers/boards_helper_spec.rb
spec/helpers/boards_helper_spec.rb
+5
-0
No files found.
app/helpers/boards_helper.rb
View file @
2ec86090
...
@@ -14,6 +14,7 @@ module BoardsHelper
...
@@ -14,6 +14,7 @@ module BoardsHelper
root_path:
root_path
,
root_path:
root_path
,
full_path:
full_path
,
full_path:
full_path
,
bulk_update_path:
@bulk_issues_path
,
bulk_update_path:
@bulk_issues_path
,
can_update:
(
!!
can?
(
current_user
,
:admin_issue
,
board
)).
to_s
,
time_tracking_limit_to_hours:
Gitlab
::
CurrentSettings
.
time_tracking_limit_to_hours
.
to_s
,
time_tracking_limit_to_hours:
Gitlab
::
CurrentSettings
.
time_tracking_limit_to_hours
.
to_s
,
recent_boards_endpoint:
recent_boards_path
,
recent_boards_endpoint:
recent_boards_path
,
parent:
current_board_parent
.
model_name
.
param_key
,
parent:
current_board_parent
.
model_name
.
param_key
,
...
...
spec/helpers/boards_helper_spec.rb
View file @
2ec86090
...
@@ -43,6 +43,7 @@ RSpec.describe BoardsHelper do
...
@@ -43,6 +43,7 @@ RSpec.describe BoardsHelper do
allow
(
helper
).
to
receive
(
:current_user
)
{
user
}
allow
(
helper
).
to
receive
(
:current_user
)
{
user
}
allow
(
helper
).
to
receive
(
:can?
).
with
(
user
,
:create_non_backlog_issues
,
board
).
and_return
(
true
)
allow
(
helper
).
to
receive
(
:can?
).
with
(
user
,
:create_non_backlog_issues
,
board
).
and_return
(
true
)
allow
(
helper
).
to
receive
(
:can?
).
with
(
user
,
:admin_issue
,
board
).
and_return
(
true
)
end
end
it
'returns a board_lists_path as lists_endpoint'
do
it
'returns a board_lists_path as lists_endpoint'
do
...
@@ -52,6 +53,10 @@ RSpec.describe BoardsHelper do
...
@@ -52,6 +53,10 @@ RSpec.describe BoardsHelper do
it
'returns board type as parent'
do
it
'returns board type as parent'
do
expect
(
helper
.
board_data
[
:parent
]).
to
eq
(
'project'
)
expect
(
helper
.
board_data
[
:parent
]).
to
eq
(
'project'
)
end
end
it
'returns can_update for user permissions on the board'
do
expect
(
helper
.
board_data
[
:can_update
]).
to
eq
(
'true'
)
end
end
end
describe
'#current_board_json'
do
describe
'#current_board_json'
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