Commit 22d53f06 authored by Tiago Botelho's avatar Tiago Botelho

Fixes 500 error caused by pending delete projects in admin dashboard

parent ea6dfcad
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