BigW Consortium Gitlab

Commit bec57406 by Sean McGivern Committed by Simon Knox

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
parent 28a5b41e
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)
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