Commit f2da36f1 authored by Sean McGivern's avatar Sean McGivern

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

Fixes 500 error caused by pending delete projects in admin dashboard

Closes #35453

See merge request !13067
parents 695f5085 22d53f06
class Admin::DashboardController < Admin::ApplicationController class Admin::DashboardController < Admin::ApplicationController
def index def index
@projects = Project.with_route.limit(10) @projects = Project.without_deleted.with_route.limit(10)
@users = User.limit(10) @users = User.limit(10)
@groups = Group.with_route.limit(10) @groups = Group.with_route.limit(10)
end end
......
---
title: Fixes 500 error caused by pending delete projects in admin dashboard
merge_request: 13067
author:
require 'spec_helper'
describe Admin::DashboardController do
describe '#index' do
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