From 0eb80fabdd46baaf06e27697cfbd2cd8900d7f67 Mon Sep 17 00:00:00 2001 From: Alexey Vakhov Date: Mon, 3 Oct 2011 10:01:52 +0400 Subject: use safe_constantize instead constantize in AC::TestCase --- actionpack/lib/action_controller/test_case.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index a83fa74795..343beae1bb 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -352,9 +352,7 @@ module ActionController end def determine_default_controller_class(name) - name.sub(/Test$/, '').constantize - rescue NameError - nil + name.sub(/Test$/, '').safe_constantize end def prepare_controller_class(new_class) -- cgit v1.2.3