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

Add latest changes from gitlab-org/gitlab@master

parent c8e28a0b
No related branches found
No related tags found
No related merge requests found
Showing
with 189 additions and 131 deletions
Loading
@@ -148,7 +148,7 @@ describe HelpController do
Loading
@@ -148,7 +148,7 @@ describe HelpController do
context 'for UI Development Kit' do context 'for UI Development Kit' do
it 'renders found' do it 'renders found' do
get :ui get :ui
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
end end
end end
Loading
Loading
Loading
@@ -17,7 +17,7 @@ describe InvitesController do
Loading
@@ -17,7 +17,7 @@ describe InvitesController do
get :accept, params: { id: token } get :accept, params: { id: token }
member.reload member.reload
   
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
expect(member.user).to eq(user) expect(member.user).to eq(user)
expect(flash[:notice]).to include 'You have been granted' expect(flash[:notice]).to include 'You have been granted'
end end
Loading
@@ -28,7 +28,7 @@ describe InvitesController do
Loading
@@ -28,7 +28,7 @@ describe InvitesController do
get :decline, params: { id: token } get :decline, params: { id: token }
expect {member.reload}.to raise_error ActiveRecord::RecordNotFound expect {member.reload}.to raise_error ActiveRecord::RecordNotFound
   
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
expect(flash[:notice]).to include 'You have declined the invitation to join' expect(flash[:notice]).to include 'You have declined the invitation to join'
end end
end end
Loading
Loading
Loading
@@ -125,7 +125,7 @@ describe NotificationSettingsController do
Loading
@@ -125,7 +125,7 @@ describe NotificationSettingsController do
notification_setting: { level: :participating } notification_setting: { level: :participating }
} }
   
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
Loading
@@ -195,7 +195,7 @@ describe NotificationSettingsController do
Loading
@@ -195,7 +195,7 @@ describe NotificationSettingsController do
notification_setting: { level: :participating } notification_setting: { level: :participating }
} }
   
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
Loading
Loading
Loading
@@ -172,7 +172,7 @@ describe OmniauthCallbacksController, type: :controller, do_not_mock_admin_mode:
Loading
@@ -172,7 +172,7 @@ describe OmniauthCallbacksController, type: :controller, do_not_mock_admin_mode:
it 'returns 403' do it 'returns 403' do
post provider post provider
   
expect(response).to have_gitlab_http_status(403) expect(response).to have_gitlab_http_status(:forbidden)
end end
end end
end end
Loading
Loading
Loading
@@ -15,7 +15,7 @@ describe PasswordsController do
Loading
@@ -15,7 +15,7 @@ describe PasswordsController do
   
post :create post :create
   
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
expect(flash[:alert]).to eq _('Password authentication is unavailable.') expect(flash[:alert]).to eq _('Password authentication is unavailable.')
end end
end end
Loading
Loading
Loading
@@ -87,7 +87,7 @@ describe ProfilesController, :request_store do
Loading
@@ -87,7 +87,7 @@ describe ProfilesController, :request_store do
put :update, params: { user: { status: { message: 'Working hard!' } } } put :update, params: { user: { status: { message: 'Working hard!' } } }
   
expect(user.reload.status.message).to eq('Working hard!') expect(user.reload.status.message).to eq('Working hard!')
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
end end
end end
   
Loading
Loading
Loading
@@ -36,7 +36,7 @@ describe Projects::BlameController do
Loading
@@ -36,7 +36,7 @@ describe Projects::BlameController do
   
it 'redirects' do it 'redirects' do
expect(subject) expect(subject)
.to redirect_to("/#{project.full_path}/tree/master") .to redirect_to("/#{project.full_path}/-/tree/master")
end end
end end
   
Loading
Loading
Loading
@@ -33,7 +33,7 @@ describe Projects::BlobController do
Loading
@@ -33,7 +33,7 @@ describe Projects::BlobController do
   
it 'redirects' do it 'redirects' do
expect(subject) expect(subject)
.to redirect_to("/#{project.full_path}/tree/master") .to redirect_to("/#{project.full_path}/-/tree/master")
end end
end end
   
Loading
@@ -115,7 +115,7 @@ describe Projects::BlobController do
Loading
@@ -115,7 +115,7 @@ describe Projects::BlobController do
   
it 'redirects' do it 'redirects' do
expect(subject) expect(subject)
.to redirect_to("/#{project.full_path}/tree/markdown/doc") .to redirect_to("/#{project.full_path}/-/tree/markdown/doc")
end end
end end
end end
Loading
Loading
Loading
@@ -38,7 +38,7 @@ describe Projects::BranchesController do
Loading
@@ -38,7 +38,7 @@ describe Projects::BranchesController do
   
it 'redirects' do it 'redirects' do
expect(subject) expect(subject)
.to redirect_to("/#{project.full_path}/tree/merge_branch") .to redirect_to("/#{project.full_path}/-/tree/merge_branch")
end end
end end
   
Loading
@@ -48,7 +48,7 @@ describe Projects::BranchesController do
Loading
@@ -48,7 +48,7 @@ describe Projects::BranchesController do
   
it 'redirects' do it 'redirects' do
expect(subject) expect(subject)
.to redirect_to("/#{project.full_path}/tree/alert('merge');") .to redirect_to("/#{project.full_path}/-/tree/alert('merge');")
end end
end end
   
Loading
@@ -93,7 +93,7 @@ describe Projects::BranchesController do
Loading
@@ -93,7 +93,7 @@ describe Projects::BranchesController do
} }
   
expect(subject) expect(subject)
.to redirect_to("/#{project.full_path}/tree/1-feature-branch") .to redirect_to("/#{project.full_path}/-/tree/1-feature-branch")
end end
   
it 'posts a system note' do it 'posts a system note' do
Loading
Loading
Loading
@@ -72,7 +72,7 @@ describe Projects::RawController do
Loading
@@ -72,7 +72,7 @@ describe Projects::RawController do
env: :raw_blob_request_limit, env: :raw_blob_request_limit,
remote_ip: '0.0.0.0', remote_ip: '0.0.0.0',
request_method: 'GET', request_method: 'GET',
path: "/#{project.full_path}/raw/#{file_path}" path: "/#{project.full_path}/-/raw/#{file_path}"
} }
   
expect(Gitlab::AuthLogger).to receive(:error).with(attributes).once expect(Gitlab::AuthLogger).to receive(:error).with(attributes).once
Loading
Loading
Loading
@@ -45,7 +45,7 @@ describe Projects::TreeController do
Loading
@@ -45,7 +45,7 @@ describe Projects::TreeController do
   
it 'redirects' do it 'redirects' do
expect(subject) expect(subject)
.to redirect_to("/#{project.full_path}/tree/master") .to redirect_to("/#{project.full_path}/-/tree/master")
end end
end end
   
Loading
@@ -60,7 +60,7 @@ describe Projects::TreeController do
Loading
@@ -60,7 +60,7 @@ describe Projects::TreeController do
   
it 'redirects' do it 'redirects' do
expect(subject) expect(subject)
.to redirect_to("/#{project.full_path}/tree/empty-branch") .to redirect_to("/#{project.full_path}/-/tree/empty-branch")
end end
end end
   
Loading
@@ -153,7 +153,7 @@ describe Projects::TreeController do
Loading
@@ -153,7 +153,7 @@ describe Projects::TreeController do
let(:id) { 'master/README.md' } let(:id) { 'master/README.md' }
   
it 'redirects' do it 'redirects' do
redirect_url = "/#{project.full_path}/blob/master/README.md" redirect_url = "/#{project.full_path}/-/blob/master/README.md"
expect(subject) expect(subject)
.to redirect_to(redirect_url) .to redirect_to(redirect_url)
end end
Loading
@@ -181,7 +181,7 @@ describe Projects::TreeController do
Loading
@@ -181,7 +181,7 @@ describe Projects::TreeController do
   
it 'redirects to the new directory' do it 'redirects to the new directory' do
expect(subject) expect(subject)
.to redirect_to("/#{project.full_path}/tree/#{branch_name}/#{path}") .to redirect_to("/#{project.full_path}/-/tree/#{branch_name}/#{path}")
expect(flash[:notice]).to eq('The directory has been successfully created.') expect(flash[:notice]).to eq('The directory has been successfully created.')
end end
end end
Loading
@@ -192,7 +192,7 @@ describe Projects::TreeController do
Loading
@@ -192,7 +192,7 @@ describe Projects::TreeController do
   
it 'does not allow overwriting of existing files' do it 'does not allow overwriting of existing files' do
expect(subject) expect(subject)
.to redirect_to("/#{project.full_path}/tree/master") .to redirect_to("/#{project.full_path}/-/tree/master")
expect(flash[:alert]).to eq('A file with this name already exists') expect(flash[:alert]).to eq('A file with this name already exists')
end end
end end
Loading
Loading
Loading
@@ -27,7 +27,7 @@ describe ProjectsController do
Loading
@@ -27,7 +27,7 @@ describe ProjectsController do
   
get :new, params: { namespace_id: group.id } get :new, params: { namespace_id: group.id }
   
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(response).to render_template('new') expect(response).to render_template('new')
end end
end end
Loading
@@ -36,7 +36,7 @@ describe ProjectsController do
Loading
@@ -36,7 +36,7 @@ describe ProjectsController do
it 'responds with status 404' do it 'responds with status 404' do
get :new, params: { namespace_id: group.id } get :new, params: { namespace_id: group.id }
   
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
expect(response).not_to render_template('new') expect(response).not_to render_template('new')
end end
end end
Loading
@@ -159,7 +159,7 @@ describe ProjectsController do
Loading
@@ -159,7 +159,7 @@ describe ProjectsController do
it 'renders a 503' do it 'renders a 503' do
get :show, params: { namespace_id: project.namespace, id: project } get :show, params: { namespace_id: project.namespace, id: project }
   
expect(response).to have_gitlab_http_status(503) expect(response).to have_gitlab_http_status(:service_unavailable)
end end
end end
   
Loading
@@ -264,7 +264,7 @@ describe ProjectsController do
Loading
@@ -264,7 +264,7 @@ describe ProjectsController do
   
get :show, params: { namespace_id: project.namespace, id: project }, format: :git get :show, params: { namespace_id: project.namespace, id: project }, format: :git
   
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
expect(response).to redirect_to(namespace_project_path) expect(response).to redirect_to(namespace_project_path)
end end
end end
Loading
@@ -331,7 +331,7 @@ describe ProjectsController do
Loading
@@ -331,7 +331,7 @@ describe ProjectsController do
id: project.path id: project.path
} }
   
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
   
it 'sets the badge API endpoint' do it 'sets the badge API endpoint' do
Loading
@@ -371,7 +371,7 @@ describe ProjectsController do
Loading
@@ -371,7 +371,7 @@ describe ProjectsController do
end end
   
it 'redirects to projects path' do it 'redirects to projects path' do
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
expect(response).to redirect_to(project_path(project)) expect(response).to redirect_to(project_path(project))
end end
end end
Loading
@@ -391,7 +391,7 @@ describe ProjectsController do
Loading
@@ -391,7 +391,7 @@ describe ProjectsController do
end end
   
it 'returns 404' do it 'returns 404' do
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
Loading
@@ -419,7 +419,7 @@ describe ProjectsController do
Loading
@@ -419,7 +419,7 @@ describe ProjectsController do
end end
   
it 'redirects to projects path' do it 'redirects to projects path' do
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
expect(response).to redirect_to(project_path(project)) expect(response).to redirect_to(project_path(project))
end end
end end
Loading
@@ -439,7 +439,7 @@ describe ProjectsController do
Loading
@@ -439,7 +439,7 @@ describe ProjectsController do
end end
   
it 'returns 404' do it 'returns 404' do
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
Loading
@@ -466,7 +466,7 @@ describe ProjectsController do
Loading
@@ -466,7 +466,7 @@ describe ProjectsController do
id: project.path id: project.path
} }
   
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
end end
end end
   
Loading
@@ -486,7 +486,7 @@ describe ProjectsController do
Loading
@@ -486,7 +486,7 @@ describe ProjectsController do
id: project.path id: project.path
} }
   
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
end end
end end
end end
Loading
@@ -521,7 +521,7 @@ describe ProjectsController do
Loading
@@ -521,7 +521,7 @@ describe ProjectsController do
expect(assign_repository_path).to include(project.path) expect(assign_repository_path).to include(project.path)
end end
   
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
end end
end end
   
Loading
@@ -537,7 +537,7 @@ describe ProjectsController do
Loading
@@ -537,7 +537,7 @@ describe ProjectsController do
.not_to change { project.reload.path } .not_to change { project.reload.path }
   
expect(controller).to set_flash.now[:alert].to(s_('UpdateProject|Cannot rename project because it contains container registry tags!')) expect(controller).to set_flash.now[:alert].to(s_('UpdateProject|Cannot rename project because it contains container registry tags!'))
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
end end
   
Loading
@@ -555,7 +555,7 @@ describe ProjectsController do
Loading
@@ -555,7 +555,7 @@ describe ProjectsController do
project: params project: params
} }
   
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
params.each do |param, value| params.each do |param, value|
expect(project.public_send(param)).to eq(value) expect(project.public_send(param)).to eq(value)
end end
Loading
@@ -653,7 +653,7 @@ describe ProjectsController do
Loading
@@ -653,7 +653,7 @@ describe ProjectsController do
project.reload project.reload
   
expect(project.namespace).to eq(new_namespace) expect(project.namespace).to eq(new_namespace)
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
   
context 'when new namespace is empty' do context 'when new namespace is empty' do
Loading
@@ -674,7 +674,7 @@ describe ProjectsController do
Loading
@@ -674,7 +674,7 @@ describe ProjectsController do
project.reload project.reload
   
expect(project.namespace).to eq(old_namespace) expect(project.namespace).to eq(old_namespace)
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(flash[:alert]).to eq s_('TransferProject|Please select a new namespace for your project.') expect(flash[:alert]).to eq s_('TransferProject|Please select a new namespace for your project.')
end end
end end
Loading
@@ -691,7 +691,7 @@ describe ProjectsController do
Loading
@@ -691,7 +691,7 @@ describe ProjectsController do
delete :destroy, params: { namespace_id: project.namespace, id: project } delete :destroy, params: { namespace_id: project.namespace, id: project }
   
expect { Project.find(orig_id) }.to raise_error(ActiveRecord::RecordNotFound) expect { Project.find(orig_id) }.to raise_error(ActiveRecord::RecordNotFound)
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
expect(response).to redirect_to(dashboard_projects_path) expect(response).to redirect_to(dashboard_projects_path)
end end
   
Loading
@@ -733,7 +733,7 @@ describe ProjectsController do
Loading
@@ -733,7 +733,7 @@ describe ProjectsController do
end end
   
it 'has http status 200' do it 'has http status 200' do
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
   
it 'changes the user incoming email token' do it 'changes the user incoming email token' do
Loading
@@ -763,7 +763,7 @@ describe ProjectsController do
Loading
@@ -763,7 +763,7 @@ describe ProjectsController do
end end
   
it 'has http status 200' do it 'has http status 200' do
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
   
it 'changes the user incoming email token' do it 'changes the user incoming email token' do
Loading
@@ -856,7 +856,7 @@ describe ProjectsController do
Loading
@@ -856,7 +856,7 @@ describe ProjectsController do
id: project id: project
}, },
format: :js) format: :js)
expect(response).to have_gitlab_http_status(401) expect(response).to have_gitlab_http_status(:unauthorized)
end end
end end
   
Loading
@@ -905,7 +905,7 @@ describe ProjectsController do
Loading
@@ -905,7 +905,7 @@ describe ProjectsController do
sign_in(user) sign_in(user)
get :refs, params: { namespace_id: project.namespace, id: project } get :refs, params: { namespace_id: project.namespace, id: project }
   
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
Loading
@@ -928,7 +928,7 @@ describe ProjectsController do
Loading
@@ -928,7 +928,7 @@ describe ProjectsController do
it 'returns 404' do it 'returns 404' do
post :preview_markdown, params: { namespace_id: private_project.namespace, id: private_project, text: '*Markdown* text' } post :preview_markdown, params: { namespace_id: private_project.namespace, id: private_project, text: '*Markdown* text' }
   
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
   
Loading
@@ -973,7 +973,7 @@ describe ProjectsController do
Loading
@@ -973,7 +973,7 @@ describe ProjectsController do
end end
   
it 'renders JSON body with image links expanded' do it 'renders JSON body with image links expanded' do
expanded_path = "/#{project_with_repo.full_path}/raw/master/files/images/logo-white.png" expanded_path = "/#{project_with_repo.full_path}/-/raw/master/files/images/logo-white.png"
   
post :preview_markdown, params: preview_markdown_params post :preview_markdown, params: preview_markdown_params
   
Loading
@@ -994,7 +994,7 @@ describe ProjectsController do
Loading
@@ -994,7 +994,7 @@ describe ProjectsController do
get :show, params: { namespace_id: public_project.namespace, id: public_project } get :show, params: { namespace_id: public_project.namespace, id: public_project }
   
expect(assigns(:project)).to eq(public_project) expect(assigns(:project)).to eq(public_project)
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
end end
   
Loading
@@ -1033,13 +1033,13 @@ describe ProjectsController do
Loading
@@ -1033,13 +1033,13 @@ describe ProjectsController do
it 'does not 404' do it 'does not 404' do
post :toggle_star, params: { namespace_id: public_project.namespace, id: public_project.path.upcase } post :toggle_star, params: { namespace_id: public_project.namespace, id: public_project.path.upcase }
   
expect(response).not_to have_gitlab_http_status(404) expect(response).not_to have_gitlab_http_status(:not_found)
end end
   
it 'does not redirect to the correct casing' do it 'does not redirect to the correct casing' do
post :toggle_star, params: { namespace_id: public_project.namespace, id: public_project.path.upcase } post :toggle_star, params: { namespace_id: public_project.namespace, id: public_project.path.upcase }
   
expect(response).not_to have_gitlab_http_status(301) expect(response).not_to have_gitlab_http_status(:moved_permanently)
end end
end end
   
Loading
@@ -1049,7 +1049,7 @@ describe ProjectsController do
Loading
@@ -1049,7 +1049,7 @@ describe ProjectsController do
it 'returns not found' do it 'returns not found' do
post :toggle_star, params: { namespace_id: 'foo', id: 'bar' } post :toggle_star, params: { namespace_id: 'foo', id: 'bar' }
   
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
Loading
@@ -1063,13 +1063,13 @@ describe ProjectsController do
Loading
@@ -1063,13 +1063,13 @@ describe ProjectsController do
it 'does not 404' do it 'does not 404' do
delete :destroy, params: { namespace_id: project.namespace, id: project.path.upcase } delete :destroy, params: { namespace_id: project.namespace, id: project.path.upcase }
   
expect(response).not_to have_gitlab_http_status(404) expect(response).not_to have_gitlab_http_status(:not_found)
end end
   
it 'does not redirect to the correct casing' do it 'does not redirect to the correct casing' do
delete :destroy, params: { namespace_id: project.namespace, id: project.path.upcase } delete :destroy, params: { namespace_id: project.namespace, id: project.path.upcase }
   
expect(response).not_to have_gitlab_http_status(301) expect(response).not_to have_gitlab_http_status(:moved_permanently)
end end
end end
   
Loading
@@ -1079,7 +1079,7 @@ describe ProjectsController do
Loading
@@ -1079,7 +1079,7 @@ describe ProjectsController do
it 'returns not found' do it 'returns not found' do
delete :destroy, params: { namespace_id: 'foo', id: 'bar' } delete :destroy, params: { namespace_id: 'foo', id: 'bar' }
   
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
Loading
@@ -1103,7 +1103,7 @@ describe ProjectsController do
Loading
@@ -1103,7 +1103,7 @@ describe ProjectsController do
get action, params: { namespace_id: project.namespace, id: project } get action, params: { namespace_id: project.namespace, id: project }
   
expect(flash[:alert]).to eq('This endpoint has been requested too many times. Try again later.') expect(flash[:alert]).to eq('This endpoint has been requested too many times. Try again later.')
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
end end
end end
   
Loading
@@ -1114,7 +1114,7 @@ describe ProjectsController do
Loading
@@ -1114,7 +1114,7 @@ describe ProjectsController do
it 'returns 302' do it 'returns 302' do
get action, params: { namespace_id: project.namespace, id: project } get action, params: { namespace_id: project.namespace, id: project }
   
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
end end
end end
   
Loading
@@ -1126,7 +1126,7 @@ describe ProjectsController do
Loading
@@ -1126,7 +1126,7 @@ describe ProjectsController do
it 'returns 404' do it 'returns 404' do
get action, params: { namespace_id: project.namespace, id: project } get action, params: { namespace_id: project.namespace, id: project }
   
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
   
Loading
@@ -1143,7 +1143,7 @@ describe ProjectsController do
Loading
@@ -1143,7 +1143,7 @@ describe ProjectsController do
it 'returns 302' do it 'returns 302' do
get action, params: { namespace_id: project.namespace, id: project } get action, params: { namespace_id: project.namespace, id: project }
   
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
end end
end end
   
Loading
@@ -1155,7 +1155,7 @@ describe ProjectsController do
Loading
@@ -1155,7 +1155,7 @@ describe ProjectsController do
it 'returns 404' do it 'returns 404' do
get action, params: { namespace_id: project.namespace, id: project } get action, params: { namespace_id: project.namespace, id: project }
   
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
   
Loading
@@ -1172,7 +1172,7 @@ describe ProjectsController do
Loading
@@ -1172,7 +1172,7 @@ describe ProjectsController do
it 'returns 302' do it 'returns 302' do
post action, params: { namespace_id: project.namespace, id: project } post action, params: { namespace_id: project.namespace, id: project }
   
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
end end
end end
   
Loading
@@ -1184,7 +1184,7 @@ describe ProjectsController do
Loading
@@ -1184,7 +1184,7 @@ describe ProjectsController do
it 'returns 404' do it 'returns 404' do
post action, params: { namespace_id: project.namespace, id: project } post action, params: { namespace_id: project.namespace, id: project }
   
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
Loading
@@ -1196,7 +1196,7 @@ describe ProjectsController do
Loading
@@ -1196,7 +1196,7 @@ describe ProjectsController do
it 'returns 302' do it 'returns 302' do
post action, params: { namespace_id: project.namespace, id: project } post action, params: { namespace_id: project.namespace, id: project }
   
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
end end
end end
   
Loading
@@ -1208,7 +1208,7 @@ describe ProjectsController do
Loading
@@ -1208,7 +1208,7 @@ describe ProjectsController do
it 'returns 404' do it 'returns 404' do
post action, params: { namespace_id: project.namespace, id: project } post action, params: { namespace_id: project.namespace, id: project }
   
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
   
Loading
@@ -1245,7 +1245,7 @@ describe ProjectsController do
Loading
@@ -1245,7 +1245,7 @@ describe ProjectsController do
it 'redirects to the project page' do it 'redirects to the project page' do
get :resolve, params: { id: project.id } get :resolve, params: { id: project.id }
   
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
expect(response).to redirect_to(project_path(project)) expect(response).to redirect_to(project_path(project))
end end
end end
Loading
@@ -1267,14 +1267,14 @@ describe ProjectsController do
Loading
@@ -1267,14 +1267,14 @@ describe ProjectsController do
it 'gives 404 for existing project' do it 'gives 404 for existing project' do
get :resolve, params: { id: project.id } get :resolve, params: { id: project.id }
   
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
   
it 'gives 404 for non-existing project' do it 'gives 404 for non-existing project' do
get :resolve, params: { id: '0' } get :resolve, params: { id: '0' }
   
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
   
Loading
@@ -1288,7 +1288,7 @@ describe ProjectsController do
Loading
@@ -1288,7 +1288,7 @@ describe ProjectsController do
it 'gives 404 for private project' do it 'gives 404 for private project' do
get :resolve, params: { id: project.id } get :resolve, params: { id: project.id }
   
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
Loading
Loading
Loading
@@ -30,7 +30,7 @@ describe RegistrationsController do
Loading
@@ -30,7 +30,7 @@ describe RegistrationsController do
   
it 'renders new template and sets the resource variable' do it 'renders new template and sets the resource variable' do
expect(subject).to render_template(:new) expect(subject).to render_template(:new)
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(assigns(:resource)).to be_a(User) expect(assigns(:resource)).to be_a(User)
end end
end end
Loading
@@ -48,7 +48,7 @@ describe RegistrationsController do
Loading
@@ -48,7 +48,7 @@ describe RegistrationsController do
   
it 'renders new template and sets the resource variable' do it 'renders new template and sets the resource variable' do
subject subject
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
expect(response).to redirect_to(new_user_session_path(anchor: 'register-pane')) expect(response).to redirect_to(new_user_session_path(anchor: 'register-pane'))
end end
end end
Loading
@@ -200,7 +200,7 @@ describe RegistrationsController do
Loading
@@ -200,7 +200,7 @@ describe RegistrationsController do
.and_call_original .and_call_original
expect(Gitlab::AuthLogger).to receive(:error).with(auth_log_attributes).once expect(Gitlab::AuthLogger).to receive(:error).with(auth_log_attributes).once
expect { post(:create, params: user_params, session: session_params) }.not_to change(User, :count) expect { post(:create, params: user_params, session: session_params) }.not_to change(User, :count)
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(response.body).to be_empty expect(response.body).to be_empty
end end
end end
Loading
Loading
Loading
@@ -21,13 +21,13 @@ describe SearchController do
Loading
@@ -21,13 +21,13 @@ describe SearchController do
it 'blocks access without a project_id' do it 'blocks access without a project_id' do
get action, params: params get action, params: params
   
expect(response).to have_gitlab_http_status(403) expect(response).to have_gitlab_http_status(:forbidden)
end end
   
it 'allows access with a project_id' do it 'allows access with a project_id' do
get action, params: params.merge(project_id: create(:project, :public).id) get action, params: params.merge(project_id: create(:project, :public).id)
   
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
end end
   
Loading
@@ -42,13 +42,13 @@ describe SearchController do
Loading
@@ -42,13 +42,13 @@ describe SearchController do
it 'renders a 403 when no project is given' do it 'renders a 403 when no project is given' do
get action, params: params get action, params: params
   
expect(response).to have_gitlab_http_status(403) expect(response).to have_gitlab_http_status(:forbidden)
end end
   
it 'renders a 200 when a project was set' do it 'renders a 200 when a project was set' do
get action, params: params.merge(project_id: project.id) get action, params: params.merge(project_id: project.id)
   
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
end end
   
Loading
@@ -57,7 +57,7 @@ describe SearchController do
Loading
@@ -57,7 +57,7 @@ describe SearchController do
it 'still allows accessing the search page' do it 'still allows accessing the search page' do
get :show get :show
   
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
end end
   
Loading
@@ -195,7 +195,7 @@ describe SearchController do
Loading
@@ -195,7 +195,7 @@ describe SearchController do
   
get :count, params: { search: 'hello', scope: 'projects' } get :count, params: { search: 'hello', scope: 'projects' }
   
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(json_response).to eq({ 'count' => '1' }) expect(json_response).to eq({ 'count' => '1' })
end end
   
Loading
Loading
Loading
@@ -22,7 +22,7 @@ describe SessionsController do
Loading
@@ -22,7 +22,7 @@ describe SessionsController do
it 'redirects to :omniauth_authorize_path' do it 'redirects to :omniauth_authorize_path' do
get(:new) get(:new)
   
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
expect(response).to redirect_to('/saml') expect(response).to redirect_to('/saml')
end end
end end
Loading
@@ -31,7 +31,7 @@ describe SessionsController do
Loading
@@ -31,7 +31,7 @@ describe SessionsController do
it 'responds with 200' do it 'responds with 200' do
get(:new, params: { auto_sign_in: 'false' }) get(:new, params: { auto_sign_in: 'false' })
   
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
end end
end end
Loading
Loading
Loading
@@ -51,7 +51,7 @@ describe SnippetsController do
Loading
@@ -51,7 +51,7 @@ describe SnippetsController do
it 'responds with status 200' do it 'responds with status 200' do
get :new get :new
   
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
   
context 'when user is not allowed to create a personal snippet' do context 'when user is not allowed to create a personal snippet' do
Loading
@@ -60,7 +60,7 @@ describe SnippetsController do
Loading
@@ -60,7 +60,7 @@ describe SnippetsController do
it 'responds with status 404' do it 'responds with status 404' do
get :new get :new
   
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
Loading
@@ -90,7 +90,7 @@ describe SnippetsController do
Loading
@@ -90,7 +90,7 @@ describe SnippetsController do
it 'responds with status 404' do it 'responds with status 404' do
get :show, params: { id: other_personal_snippet.to_param } get :show, params: { id: other_personal_snippet.to_param }
   
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
   
Loading
@@ -99,13 +99,13 @@ describe SnippetsController do
Loading
@@ -99,13 +99,13 @@ describe SnippetsController do
get :show, params: { id: personal_snippet.to_param } get :show, params: { id: personal_snippet.to_param }
   
expect(assigns(:snippet)).to eq(personal_snippet) expect(assigns(:snippet)).to eq(personal_snippet)
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
   
it 'responds with status 404 when embeddable content is requested' do it 'responds with status 404 when embeddable content is requested' do
get :show, params: { id: personal_snippet.to_param }, format: :js get :show, params: { id: personal_snippet.to_param }, format: :js
   
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
Loading
@@ -131,13 +131,13 @@ describe SnippetsController do
Loading
@@ -131,13 +131,13 @@ describe SnippetsController do
get :show, params: { id: personal_snippet.to_param } get :show, params: { id: personal_snippet.to_param }
   
expect(assigns(:snippet)).to eq(personal_snippet) expect(assigns(:snippet)).to eq(personal_snippet)
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
   
it 'responds with status 404 when embeddable content is requested' do it 'responds with status 404 when embeddable content is requested' do
get :show, params: { id: personal_snippet.to_param }, format: :js get :show, params: { id: personal_snippet.to_param }, format: :js
   
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
   
Loading
@@ -162,14 +162,14 @@ describe SnippetsController do
Loading
@@ -162,14 +162,14 @@ describe SnippetsController do
get :show, params: { id: personal_snippet.to_param } get :show, params: { id: personal_snippet.to_param }
   
expect(assigns(:snippet)).to eq(personal_snippet) expect(assigns(:snippet)).to eq(personal_snippet)
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
   
it 'responds with status 200 when embeddable content is requested' do it 'responds with status 200 when embeddable content is requested' do
get :show, params: { id: personal_snippet.to_param }, format: :js get :show, params: { id: personal_snippet.to_param }, format: :js
   
expect(assigns(:snippet)).to eq(personal_snippet) expect(assigns(:snippet)).to eq(personal_snippet)
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
end end
   
Loading
@@ -178,7 +178,7 @@ describe SnippetsController do
Loading
@@ -178,7 +178,7 @@ describe SnippetsController do
get :show, params: { id: personal_snippet.to_param } get :show, params: { id: personal_snippet.to_param }
   
expect(assigns(:snippet)).to eq(personal_snippet) expect(assigns(:snippet)).to eq(personal_snippet)
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
end end
end end
Loading
@@ -192,7 +192,7 @@ describe SnippetsController do
Loading
@@ -192,7 +192,7 @@ describe SnippetsController do
it 'responds with status 404' do it 'responds with status 404' do
get :show, params: { id: 'doesntexist' } get :show, params: { id: 'doesntexist' }
   
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
   
Loading
@@ -234,7 +234,7 @@ describe SnippetsController do
Loading
@@ -234,7 +234,7 @@ describe SnippetsController do
create_snippet(visibility_level: Snippet::PUBLIC) create_snippet(visibility_level: Snippet::PUBLIC)
end.not_to change { Snippet.count } end.not_to change { Snippet.count }
   
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
Loading
@@ -496,7 +496,7 @@ describe SnippetsController do
Loading
@@ -496,7 +496,7 @@ describe SnippetsController do
it 'responds with status 404' do it 'responds with status 404' do
get :raw, params: { id: other_personal_snippet.to_param } get :raw, params: { id: other_personal_snippet.to_param }
   
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
   
Loading
@@ -507,7 +507,7 @@ describe SnippetsController do
Loading
@@ -507,7 +507,7 @@ describe SnippetsController do
   
it 'responds with status 200' do it 'responds with status 200' do
expect(assigns(:snippet)).to eq(personal_snippet) expect(assigns(:snippet)).to eq(personal_snippet)
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
   
it 'has expected headers' do it 'has expected headers' do
Loading
@@ -517,7 +517,7 @@ describe SnippetsController do
Loading
@@ -517,7 +517,7 @@ describe SnippetsController do
end end
   
it "sets #{Gitlab::Workhorse::DETECT_HEADER} header" do it "sets #{Gitlab::Workhorse::DETECT_HEADER} header" do
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(response.header[Gitlab::Workhorse::DETECT_HEADER]).to eq "true" expect(response.header[Gitlab::Workhorse::DETECT_HEADER]).to eq "true"
end end
end end
Loading
@@ -544,7 +544,7 @@ describe SnippetsController do
Loading
@@ -544,7 +544,7 @@ describe SnippetsController do
get :raw, params: { id: personal_snippet.to_param } get :raw, params: { id: personal_snippet.to_param }
   
expect(assigns(:snippet)).to eq(personal_snippet) expect(assigns(:snippet)).to eq(personal_snippet)
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
end end
   
Loading
@@ -569,7 +569,7 @@ describe SnippetsController do
Loading
@@ -569,7 +569,7 @@ describe SnippetsController do
get :raw, params: { id: personal_snippet.to_param } get :raw, params: { id: personal_snippet.to_param }
   
expect(assigns(:snippet)).to eq(personal_snippet) expect(assigns(:snippet)).to eq(personal_snippet)
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
   
context 'CRLF line ending' do context 'CRLF line ending' do
Loading
@@ -596,7 +596,7 @@ describe SnippetsController do
Loading
@@ -596,7 +596,7 @@ describe SnippetsController do
get :raw, params: { id: personal_snippet.to_param } get :raw, params: { id: personal_snippet.to_param }
   
expect(assigns(:snippet)).to eq(personal_snippet) expect(assigns(:snippet)).to eq(personal_snippet)
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
end end
end end
Loading
@@ -610,7 +610,7 @@ describe SnippetsController do
Loading
@@ -610,7 +610,7 @@ describe SnippetsController do
it 'responds with status 404' do it 'responds with status 404' do
get :raw, params: { id: 'doesntexist' } get :raw, params: { id: 'doesntexist' }
   
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
   
Loading
@@ -712,7 +712,7 @@ describe SnippetsController do
Loading
@@ -712,7 +712,7 @@ describe SnippetsController do
it 'responds with status 404' do it 'responds with status 404' do
delete :destroy, params: { id: snippet.to_param } delete :destroy, params: { id: snippet.to_param }
   
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
Loading
Loading
Loading
@@ -46,7 +46,7 @@ describe UploadsController do
Loading
@@ -46,7 +46,7 @@ describe UploadsController do
it "returns 401 when the user is not logged in" do it "returns 401 when the user is not logged in" do
post :create, params: { model: model, id: snippet.id }, format: :json post :create, params: { model: model, id: snippet.id }, format: :json
   
expect(response).to have_gitlab_http_status(401) expect(response).to have_gitlab_http_status(:unauthorized)
end end
   
it "returns 404 when user can't comment on a snippet" do it "returns 404 when user can't comment on a snippet" do
Loading
@@ -55,7 +55,7 @@ describe UploadsController do
Loading
@@ -55,7 +55,7 @@ describe UploadsController do
sign_in(user) sign_in(user)
post :create, params: { model: model, id: private_snippet.id }, format: :json post :create, params: { model: model, id: private_snippet.id }, format: :json
   
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
   
Loading
@@ -67,7 +67,7 @@ describe UploadsController do
Loading
@@ -67,7 +67,7 @@ describe UploadsController do
it "returns an error without file" do it "returns an error without file" do
post :create, params: { model: model, id: snippet.id }, format: :json post :create, params: { model: model, id: snippet.id }, format: :json
   
expect(response).to have_gitlab_http_status(422) expect(response).to have_gitlab_http_status(:unprocessable_entity)
end end
   
it "returns an error with invalid model" do it "returns an error with invalid model" do
Loading
@@ -78,7 +78,7 @@ describe UploadsController do
Loading
@@ -78,7 +78,7 @@ describe UploadsController do
it "returns 404 status when object not found" do it "returns 404 status when object not found" do
post :create, params: { model: model, id: 9999 }, format: :json post :create, params: { model: model, id: 9999 }, format: :json
   
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
   
context 'with valid image' do context 'with valid image' do
Loading
@@ -129,7 +129,7 @@ describe UploadsController do
Loading
@@ -129,7 +129,7 @@ describe UploadsController do
it 'returns 401 when the user has no access' do it 'returns 401 when the user has no access' do
post :create, params: { model: 'user', id: user.id }, format: :json post :create, params: { model: 'user', id: user.id }, format: :json
   
expect(response).to have_gitlab_http_status(401) expect(response).to have_gitlab_http_status(:unauthorized)
end end
   
context 'when user is logged in' do context 'when user is logged in' do
Loading
@@ -188,7 +188,7 @@ describe UploadsController do
Loading
@@ -188,7 +188,7 @@ describe UploadsController do
   
post :create, params: { model: model, id: another_user.id, file: txt }, format: :json post :create, params: { model: model, id: another_user.id, file: txt }, format: :json
   
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
Loading
@@ -246,7 +246,7 @@ describe UploadsController do
Loading
@@ -246,7 +246,7 @@ describe UploadsController do
it "responds with status 401" do it "responds with status 401" do
get :show, params: { model: "user", mounted_as: "avatar", id: user.id, filename: "dk.png" } get :show, params: { model: "user", mounted_as: "avatar", id: user.id, filename: "dk.png" }
   
expect(response).to have_gitlab_http_status(401) expect(response).to have_gitlab_http_status(:unauthorized)
end end
end end
   
Loading
@@ -254,7 +254,7 @@ describe UploadsController do
Loading
@@ -254,7 +254,7 @@ describe UploadsController do
it "responds with status 200" do it "responds with status 200" do
get :show, params: { model: "user", mounted_as: "avatar", id: user.id, filename: "dk.png" } get :show, params: { model: "user", mounted_as: "avatar", id: user.id, filename: "dk.png" }
   
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
   
it_behaves_like 'content publicly cached' do it_behaves_like 'content publicly cached' do
Loading
@@ -271,7 +271,7 @@ describe UploadsController do
Loading
@@ -271,7 +271,7 @@ describe UploadsController do
it "responds with status 200" do it "responds with status 200" do
get :show, params: { model: "user", mounted_as: "avatar", id: user.id, filename: "dk.png" } get :show, params: { model: "user", mounted_as: "avatar", id: user.id, filename: "dk.png" }
   
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
   
it_behaves_like 'content publicly cached' do it_behaves_like 'content publicly cached' do
Loading
@@ -296,7 +296,7 @@ describe UploadsController do
Loading
@@ -296,7 +296,7 @@ describe UploadsController do
it "responds with status 200" do it "responds with status 200" do
get :show, params: { model: "project", mounted_as: "avatar", id: project.id, filename: "dk.png" } get :show, params: { model: "project", mounted_as: "avatar", id: project.id, filename: "dk.png" }
   
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
   
it_behaves_like 'content 5 min private cached with revalidation' do it_behaves_like 'content 5 min private cached with revalidation' do
Loading
@@ -316,7 +316,7 @@ describe UploadsController do
Loading
@@ -316,7 +316,7 @@ describe UploadsController do
it "responds with status 200" do it "responds with status 200" do
get :show, params: { model: "project", mounted_as: "avatar", id: project.id, filename: "dk.png" } get :show, params: { model: "project", mounted_as: "avatar", id: project.id, filename: "dk.png" }
   
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
   
it_behaves_like 'content 5 min private cached with revalidation' do it_behaves_like 'content 5 min private cached with revalidation' do
Loading
@@ -338,7 +338,7 @@ describe UploadsController do
Loading
@@ -338,7 +338,7 @@ describe UploadsController do
it "responds with status 401" do it "responds with status 401" do
get :show, params: { model: "project", mounted_as: "avatar", id: project.id, filename: "dk.png" } get :show, params: { model: "project", mounted_as: "avatar", id: project.id, filename: "dk.png" }
   
expect(response).to have_gitlab_http_status(401) expect(response).to have_gitlab_http_status(:unauthorized)
end end
end end
   
Loading
@@ -361,7 +361,7 @@ describe UploadsController do
Loading
@@ -361,7 +361,7 @@ describe UploadsController do
it "responds with status 401" do it "responds with status 401" do
get :show, params: { model: "project", mounted_as: "avatar", id: project.id, filename: "dk.png" } get :show, params: { model: "project", mounted_as: "avatar", id: project.id, filename: "dk.png" }
   
expect(response).to have_gitlab_http_status(401) expect(response).to have_gitlab_http_status(:unauthorized)
end end
end end
   
Loading
@@ -369,7 +369,7 @@ describe UploadsController do
Loading
@@ -369,7 +369,7 @@ describe UploadsController do
it "responds with status 200" do it "responds with status 200" do
get :show, params: { model: "project", mounted_as: "avatar", id: project.id, filename: "dk.png" } get :show, params: { model: "project", mounted_as: "avatar", id: project.id, filename: "dk.png" }
   
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
   
it_behaves_like 'content 5 min private cached with revalidation' do it_behaves_like 'content 5 min private cached with revalidation' do
Loading
@@ -386,7 +386,7 @@ describe UploadsController do
Loading
@@ -386,7 +386,7 @@ describe UploadsController do
it "responds with status 404" do it "responds with status 404" do
get :show, params: { model: "project", mounted_as: "avatar", id: project.id, filename: "dk.png" } get :show, params: { model: "project", mounted_as: "avatar", id: project.id, filename: "dk.png" }
   
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
Loading
@@ -401,7 +401,7 @@ describe UploadsController do
Loading
@@ -401,7 +401,7 @@ describe UploadsController do
it "responds with status 200" do it "responds with status 200" do
get :show, params: { model: "group", mounted_as: "avatar", id: group.id, filename: "dk.png" } get :show, params: { model: "group", mounted_as: "avatar", id: group.id, filename: "dk.png" }
   
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
   
it_behaves_like 'content 5 min private cached with revalidation' do it_behaves_like 'content 5 min private cached with revalidation' do
Loading
@@ -421,7 +421,7 @@ describe UploadsController do
Loading
@@ -421,7 +421,7 @@ describe UploadsController do
it "responds with status 200" do it "responds with status 200" do
get :show, params: { model: "group", mounted_as: "avatar", id: group.id, filename: "dk.png" } get :show, params: { model: "group", mounted_as: "avatar", id: group.id, filename: "dk.png" }
   
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
   
it_behaves_like 'content 5 min private cached with revalidation' do it_behaves_like 'content 5 min private cached with revalidation' do
Loading
@@ -457,7 +457,7 @@ describe UploadsController do
Loading
@@ -457,7 +457,7 @@ describe UploadsController do
it "responds with status 401" do it "responds with status 401" do
get :show, params: { model: "group", mounted_as: "avatar", id: group.id, filename: "dk.png" } get :show, params: { model: "group", mounted_as: "avatar", id: group.id, filename: "dk.png" }
   
expect(response).to have_gitlab_http_status(401) expect(response).to have_gitlab_http_status(:unauthorized)
end end
end end
   
Loading
@@ -465,7 +465,7 @@ describe UploadsController do
Loading
@@ -465,7 +465,7 @@ describe UploadsController do
it "responds with status 200" do it "responds with status 200" do
get :show, params: { model: "group", mounted_as: "avatar", id: group.id, filename: "dk.png" } get :show, params: { model: "group", mounted_as: "avatar", id: group.id, filename: "dk.png" }
   
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
   
it_behaves_like 'content 5 min private cached with revalidation' do it_behaves_like 'content 5 min private cached with revalidation' do
Loading
@@ -482,7 +482,7 @@ describe UploadsController do
Loading
@@ -482,7 +482,7 @@ describe UploadsController do
it "responds with status 404" do it "responds with status 404" do
get :show, params: { model: "group", mounted_as: "avatar", id: group.id, filename: "dk.png" } get :show, params: { model: "group", mounted_as: "avatar", id: group.id, filename: "dk.png" }
   
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
Loading
@@ -502,7 +502,7 @@ describe UploadsController do
Loading
@@ -502,7 +502,7 @@ describe UploadsController do
it "responds with status 200" do it "responds with status 200" do
get :show, params: { model: "note", mounted_as: "attachment", id: note.id, filename: "dk.png" } get :show, params: { model: "note", mounted_as: "attachment", id: note.id, filename: "dk.png" }
   
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
   
it_behaves_like 'content not cached' do it_behaves_like 'content not cached' do
Loading
@@ -522,7 +522,7 @@ describe UploadsController do
Loading
@@ -522,7 +522,7 @@ describe UploadsController do
it "responds with status 200" do it "responds with status 200" do
get :show, params: { model: "note", mounted_as: "attachment", id: note.id, filename: "dk.png" } get :show, params: { model: "note", mounted_as: "attachment", id: note.id, filename: "dk.png" }
   
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
   
it_behaves_like 'content not cached' do it_behaves_like 'content not cached' do
Loading
@@ -544,7 +544,7 @@ describe UploadsController do
Loading
@@ -544,7 +544,7 @@ describe UploadsController do
it "responds with status 401" do it "responds with status 401" do
get :show, params: { model: "note", mounted_as: "attachment", id: note.id, filename: "dk.png" } get :show, params: { model: "note", mounted_as: "attachment", id: note.id, filename: "dk.png" }
   
expect(response).to have_gitlab_http_status(401) expect(response).to have_gitlab_http_status(:unauthorized)
end end
end end
   
Loading
@@ -567,7 +567,7 @@ describe UploadsController do
Loading
@@ -567,7 +567,7 @@ describe UploadsController do
it "responds with status 401" do it "responds with status 401" do
get :show, params: { model: "note", mounted_as: "attachment", id: note.id, filename: "dk.png" } get :show, params: { model: "note", mounted_as: "attachment", id: note.id, filename: "dk.png" }
   
expect(response).to have_gitlab_http_status(401) expect(response).to have_gitlab_http_status(:unauthorized)
end end
end end
   
Loading
@@ -575,7 +575,7 @@ describe UploadsController do
Loading
@@ -575,7 +575,7 @@ describe UploadsController do
it "responds with status 200" do it "responds with status 200" do
get :show, params: { model: "note", mounted_as: "attachment", id: note.id, filename: "dk.png" } get :show, params: { model: "note", mounted_as: "attachment", id: note.id, filename: "dk.png" }
   
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
   
it_behaves_like 'content not cached' do it_behaves_like 'content not cached' do
Loading
@@ -592,7 +592,7 @@ describe UploadsController do
Loading
@@ -592,7 +592,7 @@ describe UploadsController do
it "responds with status 404" do it "responds with status 404" do
get :show, params: { model: "note", mounted_as: "attachment", id: note.id, filename: "dk.png" } get :show, params: { model: "note", mounted_as: "attachment", id: note.id, filename: "dk.png" }
   
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
Loading
@@ -607,7 +607,7 @@ describe UploadsController do
Loading
@@ -607,7 +607,7 @@ describe UploadsController do
it 'responds with status 200' do it 'responds with status 200' do
get :show, params: { model: 'appearance', mounted_as: 'header_logo', id: appearance.id, filename: 'dk.png' } get :show, params: { model: 'appearance', mounted_as: 'header_logo', id: appearance.id, filename: 'dk.png' }
   
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
   
it_behaves_like 'content publicly cached' do it_behaves_like 'content publicly cached' do
Loading
@@ -627,7 +627,7 @@ describe UploadsController do
Loading
@@ -627,7 +627,7 @@ describe UploadsController do
it 'responds with status 200' do it 'responds with status 200' do
get :show, params: { model: 'appearance', mounted_as: 'logo', id: appearance.id, filename: 'dk.png' } get :show, params: { model: 'appearance', mounted_as: 'logo', id: appearance.id, filename: 'dk.png' }
   
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
   
it_behaves_like 'content publicly cached' do it_behaves_like 'content publicly cached' do
Loading
@@ -648,7 +648,7 @@ describe UploadsController do
Loading
@@ -648,7 +648,7 @@ describe UploadsController do
it 'successfully returns the file' do it 'successfully returns the file' do
get :show, params: { model: 'appearance', mounted_as: 'favicon', id: appearance.id, filename: 'dk.png' } get :show, params: { model: 'appearance', mounted_as: 'favicon', id: appearance.id, filename: 'dk.png' }
   
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(response.header['Content-Disposition']).to end_with 'filename="dk.png"' expect(response.header['Content-Disposition']).to end_with 'filename="dk.png"'
end end
end end
Loading
@@ -657,7 +657,7 @@ describe UploadsController do
Loading
@@ -657,7 +657,7 @@ describe UploadsController do
it 'returns a 404' do it 'returns a 404' do
get :show, params: { model: 'appearance', mounted_as: 'favicon', id: appearance.id, filename: 'bogus.png' } get :show, params: { model: 'appearance', mounted_as: 'favicon', id: appearance.id, filename: 'bogus.png' }
   
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
Loading
Loading
Loading
@@ -28,7 +28,7 @@ describe UsersController do
Loading
@@ -28,7 +28,7 @@ describe UsersController do
it 'renders the show template' do it 'renders the show template' do
get :show, params: { username: user.username } get :show, params: { username: user.username }
   
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(response).to render_template('show') expect(response).to render_template('show')
end end
end end
Loading
@@ -53,7 +53,7 @@ describe UsersController do
Loading
@@ -53,7 +53,7 @@ describe UsersController do
   
it 'renders show' do it 'renders show' do
get :show, params: { username: user.username } get :show, params: { username: user.username }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(response).to render_template('show') expect(response).to render_template('show')
end end
end end
Loading
@@ -74,7 +74,7 @@ describe UsersController do
Loading
@@ -74,7 +74,7 @@ describe UsersController do
   
it 'renders 404' do it 'renders 404' do
get :show, params: { username: 'nonexistent' } get :show, params: { username: 'nonexistent' }
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
Loading
@@ -130,7 +130,7 @@ describe UsersController do
Loading
@@ -130,7 +130,7 @@ describe UsersController do
   
get :calendar, params: { username: public_user.username }, format: :json get :calendar, params: { username: public_user.username }, format: :json
   
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
end end
   
Loading
@@ -285,7 +285,7 @@ describe UsersController do
Loading
@@ -285,7 +285,7 @@ describe UsersController do
context 'format html' do context 'format html' do
it 'renders snippets page' do it 'renders snippets page' do
get :snippets, params: { username: user.username } get :snippets, params: { username: user.username }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(response).to render_template('show') expect(response).to render_template('show')
end end
end end
Loading
@@ -293,7 +293,7 @@ describe UsersController do
Loading
@@ -293,7 +293,7 @@ describe UsersController do
context 'format json' do context 'format json' do
it 'response with snippets json data' do it 'response with snippets json data' do
get :snippets, params: { username: user.username }, format: :json get :snippets, params: { username: user.username }, format: :json
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(json_response).to have_key('html') expect(json_response).to have_key('html')
end end
end end
Loading
Loading
<?xml version="1.0"?>
<samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" ID="jVFQbyEpSfUwqhZtJtarIaGoshwuAQMDwLoiMhzJXsv" Version="2.0" IssueInstant="2020-01-23T06:12:41.896Z" Destination="https://gitlab-example.com/users/auth/saml/callback" Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified" InResponseTo="feooghajnhofcmogakmlhpkohnmikicnfhdnjlc">
<Issuer xmlns="urn:oasis:names:tc:SAML:2.0:assertion">https://example.com/adfs/services/trust</Issuer>
<samlp:Status>
<samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/>
</samlp:Status>
<Assertion xmlns="urn:oasis:names:tc:SAML:2.0:assertion" ID="emmCjammnYdAbMWDuMAJeZvQIMBayeeYqqwvQoDclKE" IssueInstant="2020-01-23T06:12:41.896Z" Version="2.0">
<Issuer>https://example.com/adfs/services/trust</Issuer>
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
<ds:Reference URI="#jVFQbyEpSfUwqhZtJtarIaGoshwuAQMDwLoiMhzJXsv">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
<ds:DigestValue>uHuSry39P16Yh7srS32xESmj4Lw</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>fdghdfggfd=</ds:SignatureValue>
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<ds:X509Data>
<ds:X509Certificate>dfghjkl</ds:X509Certificate>
</ds:X509Data>
</KeyInfo>
</ds:Signature>
<Subject>
<NameID Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient">example@example.com</NameID>
<SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
<SubjectConfirmationData InResponseTo="cfeooghajnhofcmogakmlhpkohnmikicnfhdnjlc" NotOnOrAfter="2020-01-23T06:17:41.896Z" Recipient="https://gitlab-example.com/users/auth/saml/callback"/>
</SubjectConfirmation>
</Subject>
<Conditions NotBefore="2020-01-23T06:10:41.818Z" NotOnOrAfter="2020-01-23T07:10:41.818Z">
<AudienceRestriction>
<Audience>https://gitlab-example.com</Audience>
</AudienceRestriction>
</Conditions>
<AttributeStatement>
<Attribute Name="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress">
<AttributeValue>example@example.com</AttributeValue>
</Attribute>
<Attribute Name="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name">
<AttributeValue>Example User</AttributeValue>
</Attribute>
<Attribute Name="http://schemas.xmlsoap.org/claims/Group">
<AttributeValue>Group 1</AttributeValue>
<AttributeValue>Another Group</AttributeValue>
</Attribute>
</AttributeStatement>
<AuthnStatement AuthnInstant="2020-01-23T06:12:41.756Z" SessionIndex="perdkjfskdjfksdiertusfsdfsddeurtherukjdfgkdffg">
<AuthnContext>
<AuthnContextClassRef>urn:federation:authentication:windows</AuthnContextClassRef>
</AuthnContext>
</AuthnStatement>
</Assertion>
</samlp:Response>
Loading
@@ -97,7 +97,7 @@ describe('IDE services', () => {
Loading
@@ -97,7 +97,7 @@ describe('IDE services', () => {
   
mock mock
.onGet( .onGet(
`${relativeUrlRoot}/${TEST_PROJECT_ID}/raw/${TEST_COMMIT_SHA}/${escapeFileUrl( `${relativeUrlRoot}/${TEST_PROJECT_ID}/-/raw/${TEST_COMMIT_SHA}/${escapeFileUrl(
filePath, filePath,
)}`, )}`,
) )
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