From 77adc02cbdb3926e725dbc4f6f4cb69ed79646a3 Mon Sep 17 00:00:00 2001 From: Sarah Mei Date: Sat, 19 Feb 2011 22:17:22 -0800 Subject: [PATCH] Fix spec failure related to presence of app config settings. Also, you can't test application controller directly. --- app/controllers/application_controller.rb | 3 ++- spec/controllers/application_controller_spec.rb | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) delete mode 100644 spec/controllers/application_controller_spec.rb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 7ad6ce1de..0d778dd67 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -57,7 +57,8 @@ class ApplicationController < ActionController::Base end def redirect_unless_admin - unless AppConfig[:admins].include?(current_user.username) + admins = AppConfig[:admins] + unless admins.present? && admins.include?(current_user.username) redirect_to root_url end end diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb deleted file mode 100644 index 01847eef4..000000000 --- a/spec/controllers/application_controller_spec.rb +++ /dev/null @@ -1,4 +0,0 @@ -require 'spec_helper' - -describe ApplicationController do -end