Skip to content
Snippets Groups Projects
Commit 0d6fa033 authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 0eb3d2f7
No related branches found
No related tags found
No related merge requests found
Showing
with 112 additions and 112 deletions
Loading
Loading
@@ -15,7 +15,7 @@ describe Admin::RunnersController do
it 'lists all runners' do
get :index
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
 
it 'avoids N+1 queries', :request_store do
Loading
Loading
@@ -29,7 +29,7 @@ describe Admin::RunnersController do
# We also need to add 1 because it takes 2 queries to preload tags
expect { get :index }.not_to exceed_query_limit(control_count + 6)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(response.body).to have_content('tag1')
expect(response.body).to have_content('tag2')
end
Loading
Loading
@@ -49,13 +49,13 @@ describe Admin::RunnersController do
it 'shows a particular runner' do
get :show, params: { id: runner.id }
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
 
it 'shows 404 for unknown runner' do
get :show, params: { id: 0 }
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
 
it 'avoids N+1 queries', :request_store do
Loading
Loading
@@ -70,7 +70,7 @@ describe Admin::RunnersController do
# needs_new_sso_session permission
expect { get :show, params: { id: runner.id } }.not_to exceed_query_limit(control_count + 1)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
end
 
Loading
Loading
@@ -84,7 +84,7 @@ describe Admin::RunnersController do
 
runner.reload
 
expect(response).to have_gitlab_http_status(302)
expect(response).to have_gitlab_http_status(:found)
expect(runner.description).to eq(new_desc)
end
end
Loading
Loading
@@ -93,7 +93,7 @@ describe Admin::RunnersController do
it 'destroys the runner' do
delete :destroy, params: { id: runner.id }
 
expect(response).to have_gitlab_http_status(302)
expect(response).to have_gitlab_http_status(:found)
expect(Ci::Runner.find_by(id: runner.id)).to be_nil
end
end
Loading
Loading
@@ -108,7 +108,7 @@ describe Admin::RunnersController do
 
runner.reload
 
expect(response).to have_gitlab_http_status(302)
expect(response).to have_gitlab_http_status(:found)
expect(runner.active).to eq(true)
end
end
Loading
Loading
@@ -123,7 +123,7 @@ describe Admin::RunnersController do
 
runner.reload
 
expect(response).to have_gitlab_http_status(302)
expect(response).to have_gitlab_http_status(:found)
expect(runner.active).to eq(false)
end
end
Loading
Loading
Loading
Loading
@@ -22,7 +22,7 @@ describe Admin::ServicesController do
it 'successfully displays the template' do
get :edit, params: { id: service.id }
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
end
end
Loading
Loading
@@ -48,7 +48,7 @@ describe Admin::ServicesController do
 
put :update, params: { id: service.id, service: { active: true } }
 
expect(response).to have_gitlab_http_status(302)
expect(response).to have_gitlab_http_status(:found)
end
 
it 'does not call the propagation worker when service is not active' do
Loading
Loading
@@ -56,7 +56,7 @@ describe Admin::ServicesController do
 
put :update, params: { id: service.id, service: { properties: {} } }
 
expect(response).to have_gitlab_http_status(302)
expect(response).to have_gitlab_http_status(:found)
end
end
end
Loading
Loading
@@ -124,7 +124,7 @@ describe Admin::SessionsController, :do_not_mock_admin_mode do
it 'shows error page' do
post :destroy
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
expect(controller.current_user_mode.admin_mode?).to be(false)
end
end
Loading
Loading
Loading
Loading
@@ -16,7 +16,7 @@ describe Admin::SpamLogsController do
it 'lists all spam logs' do
get :index
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
end
 
Loading
Loading
@@ -24,14 +24,14 @@ describe Admin::SpamLogsController do
it 'removes only the spam log when removing log' do
expect { delete :destroy, params: { id: first_spam.id } }.to change { SpamLog.count }.by(-1)
expect(User.find(user.id)).to be_truthy
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
 
it 'removes user and his spam logs when removing the user', :sidekiq_might_not_need_inline do
delete :destroy, params: { id: first_spam.id, remove_user: true }
 
expect(flash[:notice]).to eq "User #{user.username} was successfully removed."
expect(response).to have_gitlab_http_status(302)
expect(response).to have_gitlab_http_status(:found)
expect(SpamLog.count).to eq(0)
expect { User.find(user.id) }.to raise_error(ActiveRecord::RecordNotFound)
end
Loading
Loading
@@ -46,7 +46,7 @@ describe Admin::SpamLogsController do
it 'submits the log as ham' do
post :mark_as_ham, params: { id: first_spam.id }
 
expect(response).to have_gitlab_http_status(302)
expect(response).to have_gitlab_http_status(:found)
expect(SpamLog.find(first_spam.id).submitted_as_ham).to be_truthy
end
end
Loading
Loading
Loading
Loading
@@ -47,7 +47,7 @@ describe Admin::UsersController do
it 'deletes user and ghosts their contributions' do
delete :destroy, params: { id: user.username }, format: :json
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(User.exists?(user.id)).to be_falsy
expect(issue.reload.author).to be_ghost
end
Loading
Loading
@@ -55,7 +55,7 @@ describe Admin::UsersController do
it 'deletes the user and their contributions when hard delete is specified' do
delete :destroy, params: { id: user.username, hard_delete: true }, format: :json
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(User.exists?(user.id)).to be_falsy
expect(Issue.exists?(issue.id)).to be_falsy
end
Loading
Loading
@@ -399,7 +399,7 @@ describe Admin::UsersController do
it "shows error page" do
post :impersonate, params: { id: user.username }
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
end
end
Loading
Loading
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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')
 
Loading
Loading
@@ -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
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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
 
Loading
Loading
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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
 
Loading
Loading
Loading
Loading
@@ -51,7 +51,7 @@ describe ControllerWithCrossProjectAccessCheck do
 
get :index
 
expect(response).to have_gitlab_http_status(403)
expect(response).to have_gitlab_http_status(:forbidden)
expect(response.body).to match(/#{message}/)
end
 
Loading
Loading
@@ -60,7 +60,7 @@ describe ControllerWithCrossProjectAccessCheck do
 
get :index
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
 
it 'is skipped when the `unless` condition returns true' do
Loading
Loading
@@ -68,13 +68,13 @@ describe ControllerWithCrossProjectAccessCheck do
 
get :index
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
 
it 'correctly renders an action that does not require cross project access' do
get :show, params: { id: 'nothing' }
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
end
 
Loading
Loading
@@ -113,7 +113,7 @@ describe ControllerWithCrossProjectAccessCheck do
it 'renders a success when the check is skipped' do
get :index
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
 
it 'is executed when the `if` condition returns false' do
Loading
Loading
@@ -121,7 +121,7 @@ describe ControllerWithCrossProjectAccessCheck do
 
get :index
 
expect(response).to have_gitlab_http_status(403)
expect(response).to have_gitlab_http_status(:forbidden)
end
 
it 'is executed when the `unless` condition returns true' do
Loading
Loading
@@ -129,19 +129,19 @@ describe ControllerWithCrossProjectAccessCheck do
 
get :index
 
expect(response).to have_gitlab_http_status(403)
expect(response).to have_gitlab_http_status(:forbidden)
end
 
it 'does not skip the check on an action that is not skipped' do
get :show, params: { id: 'hello' }
 
expect(response).to have_gitlab_http_status(403)
expect(response).to have_gitlab_http_status(:forbidden)
end
 
it 'does not skip the check on an action that was not defined to skip' do
get :edit, params: { id: 'hello' }
 
expect(response).to have_gitlab_http_status(403)
expect(response).to have_gitlab_http_status(:forbidden)
end
end
end
Loading
Loading
Loading
Loading
@@ -39,7 +39,7 @@ describe EnforcesAdminAuthentication, :do_not_mock_admin_mode do
it 'renders ok' do
get :index
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
end
end
Loading
Loading
@@ -48,7 +48,7 @@ describe EnforcesAdminAuthentication, :do_not_mock_admin_mode do
it 'renders a 404' do
get :index
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
 
it 'does not set admin mode' do
Loading
Loading
@@ -75,7 +75,7 @@ describe EnforcesAdminAuthentication, :do_not_mock_admin_mode do
let(:user) { create(:admin) }
 
it 'allows direct access to page' do
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
 
it 'does not set admin mode' do
Loading
Loading
@@ -85,7 +85,7 @@ describe EnforcesAdminAuthentication, :do_not_mock_admin_mode do
 
context 'as a user' do
it 'renders a 404' do
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
 
it 'does not set admin mode' do
Loading
Loading
Loading
Loading
@@ -30,7 +30,7 @@ describe ProjectUnauthorized do
 
get :show, params: { namespace_id: project.namespace.to_param, id: project.to_param }
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
 
it 'renders a 403 when the service denies access to the project' do
Loading
Loading
@@ -38,7 +38,7 @@ describe ProjectUnauthorized do
 
get :show, params: { namespace_id: project.namespace.to_param, id: project.to_param }
 
expect(response).to have_gitlab_http_status(403)
expect(response).to have_gitlab_http_status(:forbidden)
expect(response.body).to match("External authorization denied access to this project")
end
 
Loading
Loading
@@ -47,7 +47,7 @@ describe ProjectUnauthorized do
 
get :show, params: { namespace_id: other_project.namespace.to_param, id: other_project.to_param }
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
end
end
Loading
Loading
@@ -47,14 +47,14 @@ describe RoutableActions do
it 'allows access' do
get_routable(routable)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
end
 
it 'prevents access when not authorized' do
get_routable(routable)
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
end
 
Loading
Loading
@@ -75,14 +75,14 @@ describe RoutableActions do
it 'allows access' do
get_routable(routable)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
end
 
it 'prevents access when not authorized' do
get_routable(routable)
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
end
 
Loading
Loading
@@ -92,7 +92,7 @@ describe RoutableActions do
it 'allows access when authorized' do
get_routable(routable)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
 
it 'prevents access when unauthorized' do
Loading
Loading
@@ -100,7 +100,7 @@ describe RoutableActions do
 
get_routable(user)
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
end
end
Loading
Loading
@@ -111,7 +111,7 @@ describe RoutableActions do
 
get_routable(routable)
 
expect(response).to have_gitlab_http_status(302)
expect(response).to have_gitlab_http_status(:found)
expect(response.location).to end_with('/users/sign_in')
end
end
Loading
Loading
Loading
Loading
@@ -27,7 +27,7 @@ describe StaticObjectExternalStorage do
 
do_request
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
end
 
Loading
Loading
@@ -75,7 +75,7 @@ describe StaticObjectExternalStorage do
request.headers['X-Gitlab-External-Storage-Token'] = 'letmein'
do_request
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
end
 
Loading
Loading
@@ -84,7 +84,7 @@ describe StaticObjectExternalStorage do
request.headers['X-Gitlab-External-Storage-Token'] = 'donotletmein'
do_request
 
expect(response).to have_gitlab_http_status(403)
expect(response).to have_gitlab_http_status(:forbidden)
end
end
end
Loading
Loading
Loading
Loading
@@ -40,7 +40,7 @@ describe Dashboard::GroupsController do
it 'renders only groups the user is a member of when searching hierarchy correctly' do
get :index, params: { filter: 'chef' }, format: :json
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
all_groups = [top_level_result, top_level_a, sub_level_result_a]
expect(assigns(:groups)).to contain_exactly(*all_groups)
end
Loading
Loading
@@ -51,7 +51,7 @@ describe Dashboard::GroupsController do
 
get :index
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
end
end
Loading
Loading
@@ -40,7 +40,7 @@ describe Dashboard::MilestonesController do
it 'shows milestone page' do
view_milestone
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
end
 
Loading
Loading
@@ -55,7 +55,7 @@ describe Dashboard::MilestonesController do
it 'returns group and project milestones to which the user belongs' do
get :index, format: :json
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response.size).to eq(2)
expect(json_response.map { |i| i["name"] }).to match_array([group_milestone.name, project_milestone.name])
expect(json_response.map { |i| i["group_name"] }.compact).to match_array(group.name)
Loading
Loading
@@ -64,7 +64,7 @@ describe Dashboard::MilestonesController do
it 'returns closed group and project milestones to which the user belongs' do
get :index, params: { state: 'closed' }, format: :json
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response.size).to eq(2)
expect(json_response.map { |i| i["name"] }).to match_array([closed_group_milestone.name, closed_project_milestone.name])
expect(json_response.map { |i| i["group_name"] }.compact).to match_array(group.name)
Loading
Loading
Loading
Loading
@@ -23,7 +23,7 @@ describe Dashboard::ProjectsController do
 
get :index
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
end
 
Loading
Loading
Loading
Loading
@@ -20,19 +20,19 @@ describe Dashboard::TodosController do
 
get :index, params: { project_id: unauthorized_project.id }
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
 
it 'renders 404 when given project does not exists' do
get :index, params: { project_id: 999 }
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
 
it 'renders 200 when filtering for "any project" todos' do
get :index, params: { project_id: '' }
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
 
it 'renders 200 when user has access on given project' do
Loading
Loading
@@ -40,7 +40,7 @@ describe Dashboard::TodosController do
 
get :index, params: { project_id: authorized_project.id }
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
end
 
Loading
Loading
@@ -78,7 +78,7 @@ describe Dashboard::TodosController do
 
get :index, params: { group_id: unauthorized_group.id }
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
end
 
Loading
Loading
@@ -130,7 +130,7 @@ describe Dashboard::TodosController do
patch :restore, params: { id: todo.id }
 
expect(todo.reload).to be_pending
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response).to eq({ "count" => 1, "done_count" => 0 })
end
end
Loading
Loading
@@ -144,7 +144,7 @@ describe Dashboard::TodosController do
todos.each do |todo|
expect(todo.reload).to be_pending
end
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response).to eq({ 'count' => 2, 'done_count' => 0 })
end
end
Loading
Loading
Loading
Loading
@@ -23,7 +23,7 @@ describe GoogleApi::AuthorizationsController do
subject
 
expect(session[GoogleApi::CloudPlatform::Client.session_key_for_token]).to be_nil
expect(response).to have_http_status(:not_found)
expect(response).to have_gitlab_http_status(:not_found)
end
end
 
Loading
Loading
Loading
Loading
@@ -123,7 +123,7 @@ describe Import::BitbucketController do
 
post :create, format: :json
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
 
it 'returns 422 response when the project could not be imported' do
Loading
Loading
@@ -133,7 +133,7 @@ describe Import::BitbucketController do
 
post :create, format: :json
 
expect(response).to have_gitlab_http_status(422)
expect(response).to have_gitlab_http_status(:unprocessable_entity)
end
 
it_behaves_like 'project import rate limiter'
Loading
Loading
@@ -330,7 +330,7 @@ describe Import::BitbucketController do
 
post :create, params: { target_namespace: other_namespace.name }, format: :json
 
expect(response).to have_gitlab_http_status(422)
expect(response).to have_gitlab_http_status(:unprocessable_entity)
end
end
end
Loading
Loading
Loading
Loading
@@ -48,7 +48,7 @@ describe Import::BitbucketServerController do
 
post :create, params: { project: project_key, repository: repo_slug }, format: :json
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
 
context 'with project key with tildes' do
Loading
Loading
@@ -61,20 +61,20 @@ describe Import::BitbucketServerController do
 
post :create, params: { project: project_key, repository: repo_slug, format: :json }
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
end
 
it 'returns an error when an invalid project key is used' do
post :create, params: { project: 'some&project' }
 
expect(response).to have_gitlab_http_status(422)
expect(response).to have_gitlab_http_status(:unprocessable_entity)
end
 
it 'returns an error when an invalid repository slug is used' do
post :create, params: { project: 'some-project', repository: 'try*this' }
 
expect(response).to have_gitlab_http_status(422)
expect(response).to have_gitlab_http_status(:unprocessable_entity)
end
 
it 'returns an error when the project cannot be found' do
Loading
Loading
@@ -82,7 +82,7 @@ describe Import::BitbucketServerController do
 
post :create, params: { project: project_key, repository: repo_slug }, format: :json
 
expect(response).to have_gitlab_http_status(422)
expect(response).to have_gitlab_http_status(:unprocessable_entity)
end
 
it 'returns an error when the project cannot be saved' do
Loading
Loading
@@ -92,7 +92,7 @@ describe Import::BitbucketServerController do
 
post :create, params: { project: project_key, repository: repo_slug }, format: :json
 
expect(response).to have_gitlab_http_status(422)
expect(response).to have_gitlab_http_status(:unprocessable_entity)
end
 
it "returns an error when the server can't be contacted" do
Loading
Loading
@@ -100,7 +100,7 @@ describe Import::BitbucketServerController do
 
post :create, params: { project: project_key, repository: repo_slug }, format: :json
 
expect(response).to have_gitlab_http_status(422)
expect(response).to have_gitlab_http_status(:unprocessable_entity)
end
 
it_behaves_like 'project import rate limiter'
Loading
Loading
@@ -118,7 +118,7 @@ describe Import::BitbucketServerController do
expect(session[:bitbucket_server_username]).to be_nil
expect(session[:bitbucket_server_personal_access_token]).to be_nil
 
expect(response).to have_gitlab_http_status(302)
expect(response).to have_gitlab_http_status(:found)
expect(response).to redirect_to(status_import_bitbucket_server_path)
end
 
Loading
Loading
@@ -128,7 +128,7 @@ describe Import::BitbucketServerController do
expect(session[:bitbucket_server_url]).to eq(url)
expect(session[:bitbucket_server_username]).to eq(username)
expect(session[:bitbucket_server_personal_access_token]).to eq(token)
expect(response).to have_gitlab_http_status(302)
expect(response).to have_gitlab_http_status(:found)
expect(response).to redirect_to(status_import_bitbucket_server_path)
end
end
Loading
Loading
Loading
Loading
@@ -22,7 +22,7 @@ describe Import::GithubController do
 
get :new
 
expect(response).to have_http_status(302)
expect(response).to have_gitlab_http_status(:found)
end
 
it "prompts for an access token if GitHub not configured" do
Loading
Loading
@@ -31,7 +31,7 @@ describe Import::GithubController do
 
get :new
 
expect(response).to have_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
 
context 'when importing a CI/CD project' do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment