diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-02-24 13:33:16 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-02-24 13:33:16 -0300 |
commit | 6976e1da07ac91f5e17c6bc02758122255d94d48 (patch) | |
tree | bf031418a72213e46907da45ff171c620267a787 /actionpack/test | |
parent | 72c1557254aef2bca8a72f16a4f67862c9cca5cb (diff) | |
parent | 3fbc6328439abf14f009ae4b6fbd6ea7157d4fda (diff) | |
download | rails-6976e1da07ac91f5e17c6bc02758122255d94d48.tar.gz rails-6976e1da07ac91f5e17c6bc02758122255d94d48.tar.bz2 rails-6976e1da07ac91f5e17c6bc02758122255d94d48.zip |
Merge pull request #19060 from iainbeeston/deprecate-skip-action-callback
Deprecate `AbstractController::Callbacks#skip_action_callback`
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/filters_test.rb | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/actionpack/test/controller/filters_test.rb b/actionpack/test/controller/filters_test.rb index b9fb6be4e3..94faaeec69 100644 --- a/actionpack/test/controller/filters_test.rb +++ b/actionpack/test/controller/filters_test.rb @@ -967,8 +967,15 @@ class ControllerWithAllTypesOfFilters < PostsController end class ControllerWithTwoLessFilters < ControllerWithAllTypesOfFilters - skip_action_callback :around_again - skip_action_callback :after + skip_around_action :around_again + skip_after_action :after +end + +class SkipFilterUsingSkipActionCallback < ControllerWithAllTypesOfFilters + ActiveSupport::Deprecation.silence do + skip_action_callback :around_again + skip_action_callback :after + end end class YieldingAroundFiltersTest < ActionController::TestCase @@ -1055,6 +1062,19 @@ class YieldingAroundFiltersTest < ActionController::TestCase assert_equal 3, controller.instance_variable_get(:@try) end + def test_skipping_with_skip_action_callback + test_process(SkipFilterUsingSkipActionCallback,'no_raise') + assert_equal 'before around (before yield) around (after yield)', assigns['ran_filter'].join(' ') + end + + def test_deprecated_skip_action_callback + assert_deprecated do + Class.new(TestController) do + skip_action_callback :clean_up + end + end + end + protected def test_process(controller, action = "show") @controller = controller.is_a?(Class) ? controller.new : controller |