Commit f2194e69 authored by Vasilii Iakliushin's avatar Vasilii Iakliushin

Fix typo in RepositoryController#cleanup

Sentry error:
https://sentry.gitlab.net/gitlab/gitlabcom/issues/3173230

Use `result` instead of `status`

Changelog: fixed
parent 63a7d839
......@@ -25,7 +25,7 @@ module Projects
if result[:status] == :success
flash[:notice] = _('Repository cleanup has started. You will receive an email once the cleanup operation is complete.')
else
flash[:alert] = status.fetch(:message, _('Failed to upload object map file'))
flash[:alert] = result.fetch(:message, _('Failed to upload object map file'))
end
redirect_to project_settings_repository_path(project)
......
......@@ -33,6 +33,20 @@ RSpec.describe Projects::Settings::RepositoryController do
expect(response).to redirect_to project_settings_repository_path(project)
end
context 'when project cleanup returns an error', :aggregate_failures do
it 'shows an error' do
expect(Projects::CleanupService)
.to receive(:enqueue)
.with(project, user, anything)
.and_return(status: :error, message: 'error message')
put :cleanup, params: { namespace_id: project.namespace, project_id: project, project: { bfg_object_map: object_map } }
expect(controller).to set_flash[:alert].to('error message')
expect(response).to redirect_to project_settings_repository_path(project)
end
end
end
describe 'POST create_deploy_token' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment