diff options
Diffstat (limited to 'spec/controllers/boards')
-rw-r--r-- | spec/controllers/boards/issues_controller_spec.rb | 36 | ||||
-rw-r--r-- | spec/controllers/boards/lists_controller_spec.rb | 40 |
2 files changed, 38 insertions, 38 deletions
diff --git a/spec/controllers/boards/issues_controller_spec.rb b/spec/controllers/boards/issues_controller_spec.rb index d54f7ad33cf..605fff60c31 100644 --- a/spec/controllers/boards/issues_controller_spec.rb +++ b/spec/controllers/boards/issues_controller_spec.rb @@ -28,7 +28,7 @@ describe Boards::IssuesController do it 'returns a not found 404 response' do list_issues user: user, board: 999, list: list2 - expect(response).to have_gitlab_http_status(404) + expect(response).to have_gitlab_http_status(:not_found) end end @@ -106,7 +106,7 @@ describe Boards::IssuesController do it 'returns a not found 404 response' do list_issues user: user, board: board, list: 999 - expect(response).to have_gitlab_http_status(404) + expect(response).to have_gitlab_http_status(:not_found) end end end @@ -132,7 +132,7 @@ describe Boards::IssuesController do it 'returns a forbidden 403 response' do list_issues user: unauth_user, board: board, list: list2 - expect(response).to have_gitlab_http_status(403) + expect(response).to have_gitlab_http_status(:forbidden) end end @@ -148,7 +148,7 @@ describe Boards::IssuesController do list_issues(user: user, board: group_board) - expect(response).to have_gitlab_http_status(403) + expect(response).to have_gitlab_http_status(:forbidden) end it 'is successful for project boards' do @@ -156,7 +156,7 @@ describe Boards::IssuesController do list_issues(user: user, board: project_board) - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) end end @@ -215,7 +215,7 @@ describe Boards::IssuesController do expect(response).to have_gitlab_http_status(expected_status) list_issues user: requesting_user, board: board, list: list2 - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) expect(response).to match_response_schema('entities/issue_boards') @@ -391,7 +391,7 @@ describe Boards::IssuesController do it 'returns a successful 200 response' do create_issue user: user, board: board, list: list1, title: 'New issue' - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) end it 'returns the created issue' do @@ -406,7 +406,7 @@ describe Boards::IssuesController do it 'returns an unprocessable entity 422 response' do create_issue user: user, board: board, list: list1, title: nil - expect(response).to have_gitlab_http_status(422) + expect(response).to have_gitlab_http_status(:unprocessable_entity) end end @@ -416,7 +416,7 @@ describe Boards::IssuesController do create_issue user: user, board: board, list: list, title: 'New issue' - expect(response).to have_gitlab_http_status(404) + expect(response).to have_gitlab_http_status(:not_found) end end @@ -424,7 +424,7 @@ describe Boards::IssuesController do it 'returns a not found 404 response' do create_issue user: user, board: 999, list: list1, title: 'New issue' - expect(response).to have_gitlab_http_status(404) + expect(response).to have_gitlab_http_status(:not_found) end end @@ -432,7 +432,7 @@ describe Boards::IssuesController do it 'returns a not found 404 response' do create_issue user: user, board: board, list: 999, title: 'New issue' - expect(response).to have_gitlab_http_status(404) + expect(response).to have_gitlab_http_status(:not_found) end end end @@ -443,7 +443,7 @@ describe Boards::IssuesController 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(200) + expect(response).to have_gitlab_http_status(:ok) end end @@ -451,7 +451,7 @@ describe Boards::IssuesController 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) + expect(response).to have_gitlab_http_status(:forbidden) end end end @@ -475,7 +475,7 @@ describe Boards::IssuesController do it 'returns a successful 200 response' do move user: user, board: board, issue: issue, from_list_id: list1.id, to_list_id: list2.id - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) end it 'moves issue to the desired list' do @@ -489,19 +489,19 @@ describe Boards::IssuesController do it 'returns a unprocessable entity 422 response for invalid lists' do move user: user, board: board, issue: issue, from_list_id: nil, to_list_id: nil - expect(response).to have_gitlab_http_status(422) + expect(response).to have_gitlab_http_status(:unprocessable_entity) end it 'returns a not found 404 response for invalid board id' do move user: user, board: 999, issue: issue, from_list_id: list1.id, to_list_id: list2.id - expect(response).to have_gitlab_http_status(404) + expect(response).to have_gitlab_http_status(:not_found) end it 'returns a not found 404 response for invalid issue id' do move user: user, board: board, issue: double(id: 999), from_list_id: list1.id, to_list_id: list2.id - expect(response).to have_gitlab_http_status(404) + expect(response).to have_gitlab_http_status(:not_found) end end @@ -515,7 +515,7 @@ describe Boards::IssuesController do it 'returns a forbidden 403 response' do move user: guest, board: board, issue: issue, from_list_id: list1.id, to_list_id: list2.id - expect(response).to have_gitlab_http_status(403) + expect(response).to have_gitlab_http_status(:forbidden) end end diff --git a/spec/controllers/boards/lists_controller_spec.rb b/spec/controllers/boards/lists_controller_spec.rb index bc46d02556b..3886388bcf4 100644 --- a/spec/controllers/boards/lists_controller_spec.rb +++ b/spec/controllers/boards/lists_controller_spec.rb @@ -21,7 +21,7 @@ describe Boards::ListsController do it 'returns a successful 200 response' do read_board_list user: user, board: board - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) expect(response.content_type).to eq 'application/json' end @@ -50,7 +50,7 @@ describe Boards::ListsController do it 'returns a forbidden 403 response' do read_board_list user: unauth_user, board: board - expect(response).to have_gitlab_http_status(403) + expect(response).to have_gitlab_http_status(:forbidden) end end @@ -73,7 +73,7 @@ describe Boards::ListsController do it 'returns a successful 200 response' do create_board_list user: user, board: board, label_id: label.id - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) end it 'returns the created list' do @@ -88,7 +88,7 @@ describe Boards::ListsController do it 'returns a not found 404 response' do create_board_list user: user, board: board, label_id: nil - expect(response).to have_gitlab_http_status(404) + expect(response).to have_gitlab_http_status(:not_found) end end @@ -98,7 +98,7 @@ describe Boards::ListsController do create_board_list user: user, board: board, label_id: label.id - expect(response).to have_gitlab_http_status(404) + expect(response).to have_gitlab_http_status(:not_found) end end end @@ -109,7 +109,7 @@ describe Boards::ListsController do create_board_list user: guest, board: board, label_id: label.id - expect(response).to have_gitlab_http_status(403) + expect(response).to have_gitlab_http_status(:forbidden) end end @@ -134,7 +134,7 @@ describe Boards::ListsController do it 'returns a successful 200 response' do move user: user, board: board, list: planning, position: 1 - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) end it 'moves the list to the desired position' do @@ -148,7 +148,7 @@ describe Boards::ListsController do it 'returns an unprocessable entity 422 response' do move user: user, board: board, list: planning, position: 6 - expect(response).to have_gitlab_http_status(422) + expect(response).to have_gitlab_http_status(:unprocessable_entity) end end @@ -156,7 +156,7 @@ describe Boards::ListsController do it 'returns a not found 404 response' do move user: user, board: board, list: 999, position: 1 - expect(response).to have_gitlab_http_status(404) + expect(response).to have_gitlab_http_status(:not_found) end end @@ -164,7 +164,7 @@ describe Boards::ListsController do it 'returns a 422 unprocessable entity response' do move user: guest, board: board, list: planning, position: 6 - expect(response).to have_gitlab_http_status(422) + expect(response).to have_gitlab_http_status(:unprocessable_entity) end end @@ -173,14 +173,14 @@ describe Boards::ListsController do save_setting user: user, board: board, list: planning, setting: { collapsed: true } expect(planning.preferences_for(user).collapsed).to eq(true) - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) end it 'saves not collapsed preference for user' do save_setting user: user, board: board, list: planning, setting: { collapsed: false } expect(planning.preferences_for(user).collapsed).to eq(false) - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) end end @@ -191,14 +191,14 @@ describe Boards::ListsController do save_setting user: user, board: board, list: closed, setting: { collapsed: true } expect(closed.preferences_for(user).collapsed).to eq(true) - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) end it 'saves not collapsed preference for user' do save_setting user: user, board: board, list: closed, setting: { collapsed: false } expect(closed.preferences_for(user).collapsed).to eq(false) - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) end end @@ -236,7 +236,7 @@ describe Boards::ListsController do it 'returns a successful 200 response' do remove_board_list user: user, board: board, list: planning - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) end it 'removes list from board' do @@ -248,7 +248,7 @@ describe Boards::ListsController do it 'returns a not found 404 response' do remove_board_list user: user, board: board, list: 999 - expect(response).to have_gitlab_http_status(404) + expect(response).to have_gitlab_http_status(:not_found) end end @@ -256,7 +256,7 @@ describe Boards::ListsController do it 'returns a forbidden 403 response' do remove_board_list user: guest, board: board, list: planning - expect(response).to have_gitlab_http_status(403) + expect(response).to have_gitlab_http_status(:forbidden) end end @@ -278,7 +278,7 @@ describe Boards::ListsController do it 'returns a successful 200 response' do generate_default_lists user: user, board: board - expect(response).to have_gitlab_http_status(200) + expect(response).to have_gitlab_http_status(:ok) end it 'returns the defaults lists' do @@ -294,7 +294,7 @@ describe Boards::ListsController do generate_default_lists user: user, board: board - expect(response).to have_gitlab_http_status(422) + expect(response).to have_gitlab_http_status(:unprocessable_entity) end end @@ -302,7 +302,7 @@ describe Boards::ListsController do it 'returns a forbidden 403 response' do generate_default_lists user: guest, board: board - expect(response).to have_gitlab_http_status(403) + expect(response).to have_gitlab_http_status(:forbidden) end end |