summaryrefslogtreecommitdiff
path: root/spec/controllers/admin
diff options
context:
space:
mode:
authorTiago Botelho <tiagonbotelho@hotmail.com>2017-07-25 10:09:21 +0100
committerTiago Botelho <tiagonbotelho@hotmail.com>2017-07-25 17:59:47 +0100
commit22d53f06076e52165af3ba04d0b703bed20cfb97 (patch)
tree90f9a9a241452023e72d6f85e3d8abb0da5a9809 /spec/controllers/admin
parentea6dfcad9fdb2c673c1074c6d99ff1cca42d680a (diff)
downloadgitlab-ce-22d53f06076e52165af3ba04d0b703bed20cfb97.tar.gz
Fixes 500 error caused by pending delete projects in admin dashboard35453-pending-delete-projects-error-in-admin-dashboard-fix
Diffstat (limited to 'spec/controllers/admin')
-rw-r--r--spec/controllers/admin/dashboard_controller_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/controllers/admin/dashboard_controller_spec.rb b/spec/controllers/admin/dashboard_controller_spec.rb
new file mode 100644
index 00000000000..6eb9f7867d5
--- /dev/null
+++ b/spec/controllers/admin/dashboard_controller_spec.rb
@@ -0,0 +1,21 @@
+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