Commit e61da3ad authored by Sean McGivern's avatar Sean McGivern

Merge branch 'ee-35453-pending-delete-projects-error-in-admin-dashboard-fix' into 'master'

Fixes 500 error caused by pending delete projects in admin dashboard

See merge request !2518
parents f656b2e5 eb6bba66
class Admin::DashboardController < Admin::ApplicationController
def index
@projects = Project.with_route.limit(10)
@projects = Project.without_deleted.with_route.limit(10)
@users = User.limit(10)
@groups = Group.with_route.limit(10)
@license = License.current
......
---
title: Fixes 500 error caused by pending delete projects in admin dashboard
merge_request: 13067
author:
......@@ -22,5 +22,21 @@ describe Admin::DashboardController do
expect(response).to have_http_status(404)
end
context 'with pending_delete projects' do
render_views
it 'does not retrieve projects that are pending deletion' do
sign_in(create(:admin))
project = create(:project)
pending_delete_project = create(:project, pending_delete: true)
get :index
expect(response.body).to match(project.name)
expect(response.body).not_to match(pending_delete_project.name)
end
end
end
end
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