diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-05-15 17:45:50 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-05-15 17:45:50 -0700 |
commit | 9db6e63bfbb1756a6f43620dfa7e099d89c46dd0 (patch) | |
tree | b3560f8241a8779ed392e9dd5433f90c9939ae42 /actionpack/test/controller | |
parent | dcc1267feeff2bed4174c618ef3050615d0bafb0 (diff) | |
parent | 8da819eef5f11cc016ffa9ad747421ee50be32fa (diff) | |
download | rails-9db6e63bfbb1756a6f43620dfa7e099d89c46dd0.tar.gz rails-9db6e63bfbb1756a6f43620dfa7e099d89c46dd0.tar.bz2 rails-9db6e63bfbb1756a6f43620dfa7e099d89c46dd0.zip |
Merge pull request #10591 from acapilleri/cond_callback_test
add test for skip_before_filter with condition
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/filters_test.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/actionpack/test/controller/filters_test.rb b/actionpack/test/controller/filters_test.rb index e74bc2bb3d..4c82625e8e 100644 --- a/actionpack/test/controller/filters_test.rb +++ b/actionpack/test/controller/filters_test.rb @@ -213,6 +213,14 @@ class FilterTest < ActionController::TestCase before_filter :clean_up_tmp, :if => Proc.new { |c| false } end + class ConditionalOptionsSkipFilter < ConditionalFilterController + before_filter :ensure_login + before_filter :clean_up_tmp + + skip_before_filter :ensure_login, if: -> { false } + skip_before_filter :clean_up_tmp, if: -> { true } + end + class PrependingController < TestController prepend_before_filter :wonderful_life # skip_before_filter :fire_flash @@ -593,6 +601,11 @@ class FilterTest < ActionController::TestCase assert_equal %w( ensure_login ), assigns["ran_filter"] end + def test_running_conditional_skip_options + test_process(ConditionalOptionsSkipFilter) + assert_equal %w( ensure_login ), assigns["ran_filter"] + end + def test_running_collection_condition_filters test_process(ConditionalCollectionFilterController) assert_equal %w( ensure_login ), assigns["ran_filter"] |