diff options
author | Mike Moore <mike@blowmage.com> | 2012-09-24 14:15:21 -0600 |
---|---|---|
committer | Mike Moore <mike@blowmage.com> | 2012-09-24 14:15:21 -0600 |
commit | fdc11fd01a4cc4f5580bf9e5a782f2a97c8442f7 (patch) | |
tree | 5598cfb0d4b334216a3fc69e9a783d9026e8a7e9 /actionpack/lib/action_controller | |
parent | 4894eef448b19b326946096d0ec08700f67cd649 (diff) | |
download | rails-fdc11fd01a4cc4f5580bf9e5a782f2a97c8442f7.tar.gz rails-fdc11fd01a4cc4f5580bf9e5a782f2a97c8442f7.tar.bz2 rails-fdc11fd01a4cc4f5580bf9e5a782f2a97c8442f7.zip |
Support controller tests using spec DSL - fixes #7743
Add tests for controller tests using the minitest spec DSL.
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/test_case.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index bb693c6494..b9d8d39c9c 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -347,9 +347,9 @@ module ActionController # assert_redirected_to page_url(:title => 'foo') class TestCase < ActiveSupport::TestCase - # Use AS::TestCase for the base class when describing a model + # Use AC::TestCase for the base class when describing a controller register_spec_type(self) do |desc| - Class === desc && desc < ActionController::Base + Class === desc && desc < ActionController::Metal end module Behavior @@ -391,7 +391,9 @@ module ActionController end def determine_default_controller_class(name) - name.sub(/Test$/, '').safe_constantize + determine_constant_from_test_name(name) do |constant| + Class === constant && constant < ActionController::Metal + end end def prepare_controller_class(new_class) |