diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2018-10-26 14:19:22 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-10-26 14:19:22 +0300 |
commit | ad8a859b6efab6e9aabb8f4e5f1f0e38b1365a1a (patch) | |
tree | a2ee29ef31b2fdc8b5d65ce7915ad3a52e46480e /spec | |
parent | 8325a1fc9f0b2c9cea9073d4377f2b3b35771e8b (diff) | |
parent | fdb46c55ee52542c6147f24363087185891e0703 (diff) |
Merge branch '52545-guest-create-issue-in-group-board' into 'master'
Resolve "Adding issues from group/project board is not allowed for project-level users"
See merge request gitlab-org/gitlab-ce!22557
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/boards/issues_controller_spec.rb | 19 | ||||
-rw-r--r-- | spec/features/boards/new_issue_spec.rb | 10 |
2 files changed, 23 insertions, 6 deletions
diff --git a/spec/controllers/boards/issues_controller_spec.rb b/spec/controllers/boards/issues_controller_spec.rb index c365988a100..98946e4287b 100644 --- a/spec/controllers/boards/issues_controller_spec.rb +++ b/spec/controllers/boards/issues_controller_spec.rb @@ -208,11 +208,22 @@ describe Boards::IssuesController do end end - context 'with unauthorized user' do - it 'returns a forbidden 403 response' do - create_issue user: guest, board: board, list: list1, title: 'New issue' + context 'with guest user' do + context 'in open list' do + it 'returns a successful 200 response' do + open_list = board.lists.create(list_type: :backlog) + create_issue user: guest, board: board, list: open_list, title: 'New issue' - expect(response).to have_gitlab_http_status(403) + expect(response).to have_gitlab_http_status(200) + end + end + + context 'in label list' do + it 'returns a forbidden 403 response' do + create_issue user: guest, board: board, list: list1, title: 'New issue' + + expect(response).to have_gitlab_http_status(403) + end end end diff --git a/spec/features/boards/new_issue_spec.rb b/spec/features/boards/new_issue_spec.rb index 0bf1ecbc433..164442a47f5 100644 --- a/spec/features/boards/new_issue_spec.rb +++ b/spec/features/boards/new_issue_spec.rb @@ -94,8 +94,14 @@ describe 'Issue Boards new issue', :js do wait_for_requests end - it 'does not display new issue button' do - expect(page).to have_selector('.issue-count-badge-add-button', count: 0) + it 'displays new issue button in open list' do + expect(first('.board')).to have_selector('.issue-count-badge-add-button', count: 1) + end + + it 'does not display new issue button in label list' do + page.within('.board:nth-child(2)') do + expect(page).not_to have_selector('.issue-count-badge-add-button') + end end end end |