diff options
Diffstat (limited to 'spec/controllers/boards/lists_controller_spec.rb')
-rw-r--r-- | spec/controllers/boards/lists_controller_spec.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/spec/controllers/boards/lists_controller_spec.rb b/spec/controllers/boards/lists_controller_spec.rb index 9b09f46d17e..29141582c6f 100644 --- a/spec/controllers/boards/lists_controller_spec.rb +++ b/spec/controllers/boards/lists_controller_spec.rb @@ -22,7 +22,7 @@ RSpec.describe Boards::ListsController do read_board_list user: user, board: board expect(response).to have_gitlab_http_status(:ok) - expect(response.content_type).to eq 'application/json' + expect(response.media_type).to eq 'application/json' end it 'returns a list of board lists' do @@ -85,20 +85,22 @@ RSpec.describe Boards::ListsController do context 'with invalid params' do context 'when label is nil' do - it 'returns a not found 404 response' do + it 'returns an unprocessable entity 422 response' do create_board_list user: user, board: board, label_id: nil - expect(response).to have_gitlab_http_status(:not_found) + expect(response).to have_gitlab_http_status(:unprocessable_entity) + expect(json_response['errors']).to eq(['Label not found']) end end context 'when label that does not belongs to project' do - it 'returns a not found 404 response' do + it 'returns an unprocessable entity 422 response' do label = create(:label, name: 'Development') create_board_list user: user, board: board, label_id: label.id - expect(response).to have_gitlab_http_status(:not_found) + expect(response).to have_gitlab_http_status(:unprocessable_entity) + expect(json_response['errors']).to eq(['Label not found']) end end end |