Commit 2ec86090 authored by Scott Stern's avatar Scott Stern Committed by Dylan Griffith

Add can_update in boards_helper.rb

parent a51c9471
......@@ -14,6 +14,7 @@ module BoardsHelper
root_path: root_path,
full_path: full_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,
recent_boards_endpoint: recent_boards_path,
parent: current_board_parent.model_name.param_key,
......
......@@ -43,6 +43,7 @@ RSpec.describe BoardsHelper do
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, :admin_issue, board).and_return(true)
end
it 'returns a board_lists_path as lists_endpoint' do
......@@ -52,6 +53,10 @@ RSpec.describe BoardsHelper do
it 'returns board type as parent' do
expect(helper.board_data[:parent]).to eq('project')
end
it 'returns can_update for user permissions on the board' do
expect(helper.board_data[:can_update]).to eq('true')
end
end
describe '#current_board_json' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment