diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 10:00:54 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 10:00:54 +0000 |
commit | 3cccd102ba543e02725d247893729e5c73b38295 (patch) | |
tree | f36a04ec38517f5deaaacb5acc7d949688d1e187 /spec/helpers/boards_helper_spec.rb | |
parent | 205943281328046ef7b4528031b90fbda70c75ac (diff) | |
download | gitlab-ce-3cccd102ba543e02725d247893729e5c73b38295.tar.gz |
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'spec/helpers/boards_helper_spec.rb')
-rw-r--r-- | spec/helpers/boards_helper_spec.rb | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/spec/helpers/boards_helper_spec.rb b/spec/helpers/boards_helper_spec.rb index ec949fde30e..8d5dc3fb4be 100644 --- a/spec/helpers/boards_helper_spec.rb +++ b/spec/helpers/boards_helper_spec.rb @@ -102,6 +102,7 @@ RSpec.describe BoardsHelper do allow(helper).to receive(:can?).with(user, :create_non_backlog_issues, project_board).and_return(true) allow(helper).to receive(:can?).with(user, :admin_issue, project_board).and_return(true) allow(helper).to receive(:can?).with(user, :admin_issue_board_list, project).and_return(false) + allow(helper).to receive(:can?).with(user, :admin_issue_board, project).and_return(false) end it 'returns a board_lists_path as lists_endpoint' do @@ -129,12 +130,23 @@ RSpec.describe BoardsHelper do it 'returns can_admin_list as false by default' do expect(helper.board_data[:can_admin_list]).to eq('false') end - it 'returns can_admin_list as true when user can admin the board' do + it 'returns can_admin_list as true when user can admin the board lists' do allow(helper).to receive(:can?).with(user, :admin_issue_board_list, project).and_return(true) expect(helper.board_data[:can_admin_list]).to eq('true') end end + + context 'can_admin_board' do + it 'returns can_admin_board as false by default' do + expect(helper.board_data[:can_admin_board]).to eq('false') + end + it 'returns can_admin_board as true when user can admin the board' do + allow(helper).to receive(:can?).with(user, :admin_issue_board, project).and_return(true) + + expect(helper.board_data[:can_admin_board]).to eq('true') + end + end end context 'group board' do @@ -146,6 +158,7 @@ RSpec.describe BoardsHelper do allow(helper).to receive(:can?).with(user, :create_non_backlog_issues, group_board).and_return(true) allow(helper).to receive(:can?).with(user, :admin_issue, group_board).and_return(true) allow(helper).to receive(:can?).with(user, :admin_issue_board_list, base_group).and_return(false) + allow(helper).to receive(:can?).with(user, :admin_issue_board, base_group).and_return(false) end it 'returns correct path for base group' do @@ -165,7 +178,7 @@ RSpec.describe BoardsHelper do it 'returns can_admin_list as false by default' do expect(helper.board_data[:can_admin_list]).to eq('false') end - it 'returns can_admin_list as true when user can admin the board' do + it 'returns can_admin_list as true when user can admin the board lists' do allow(helper).to receive(:can?).with(user, :admin_issue_board_list, base_group).and_return(true) expect(helper.board_data[:can_admin_list]).to eq('true') |