diff options
author | Heinrich Lee Yu <hleeyu@gmail.com> | 2018-10-25 06:38:02 +0300 |
---|---|---|
committer | Heinrich Lee Yu <hleeyu@gmail.com> | 2018-10-26 05:27:25 +0300 |
commit | 2ba71571de1147e6b5e6e6f8c14b05d07c6050c2 (patch) | |
tree | 976f32acaeb013f011123e8286849af8b614f493 /spec/controllers/boards/issues_controller_spec.rb | |
parent | 6dda85927d88461506e7255f5ba49bdeac33699e (diff) |
Simplify query and add tests for authorization change
Diffstat (limited to 'spec/controllers/boards/issues_controller_spec.rb')
-rw-r--r-- | spec/controllers/boards/issues_controller_spec.rb | 19 |
1 files changed, 15 insertions, 4 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 |