diff options
Diffstat (limited to 'actionpack/test/controller/base_test.rb')
-rw-r--r-- | actionpack/test/controller/base_test.rb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/actionpack/test/controller/base_test.rb b/actionpack/test/controller/base_test.rb index b97ceb4594..b57550a69a 100644 --- a/actionpack/test/controller/base_test.rb +++ b/actionpack/test/controller/base_test.rb @@ -10,12 +10,12 @@ module Submodule def public_action render :nothing => true end - + hide_action :hidden_action def hidden_action raise "Noooo!" end - + def another_hidden_action end hide_action :another_hidden_action @@ -30,25 +30,25 @@ class NonEmptyController < ActionController::Base def public_action render :nothing => true end - + hide_action :hidden_action def hidden_action end end class MethodMissingController < ActionController::Base - + hide_action :shouldnt_be_called def shouldnt_be_called raise "NO WAY!" end - + protected - + def method_missing(selector) render :text => selector.to_s end - + end class DefaultUrlOptionsController < ActionController::Base @@ -79,7 +79,7 @@ class ControllerInstanceTests < Test::Unit::TestCase @empty = EmptyController.new @contained = Submodule::ContainedEmptyController.new @empty_controllers = [@empty, @contained, Submodule::SubclassedController.new] - + @non_empty_controllers = [NonEmptyController.new, Submodule::ContainedNonEmptyController.new] end @@ -135,24 +135,24 @@ class PerformActionTest < ActionController::TestCase rescue_action_in_public! end - + def test_get_on_priv_should_show_selector use_controller MethodMissingController get :shouldnt_be_called assert_response :success assert_equal 'shouldnt_be_called', @response.body end - + def test_method_missing_is_not_an_action_name use_controller MethodMissingController assert ! @controller.__send__(:action_method?, 'method_missing') - + get :method_missing assert_response :success assert_equal 'method_missing', @response.body end - + def test_get_on_hidden_should_fail use_controller NonEmptyController assert_raise(ActionController::UnknownAction) { get :hidden_action } |