diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-04-06 03:51:52 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-04-06 03:51:52 +0000 |
commit | 42d8548e94395435ccc00b453a4db65aca157726 (patch) | |
tree | a6d00dc574222d8e31d4d06935c0e66a56b1b5ae /actionpack/test | |
parent | 0f0d926def0fd2e5ce806e5a413d12c007dd3b47 (diff) | |
download | rails-42d8548e94395435ccc00b453a4db65aca157726.tar.gz rails-42d8548e94395435ccc00b453a4db65aca157726.tar.bz2 rails-42d8548e94395435ccc00b453a4db65aca157726.zip |
Failed test for Marcel to ponder
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4178 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/filters_test.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/actionpack/test/controller/filters_test.rb b/actionpack/test/controller/filters_test.rb index 2459236002..d92143e41d 100644 --- a/actionpack/test/controller/filters_test.rb +++ b/actionpack/test/controller/filters_test.rb @@ -117,6 +117,8 @@ class FilterTest < Test::Unit::TestCase class ConditionalSkippingController < TestController skip_before_filter :ensure_login, :only => [ :login ] skip_after_filter :clean_up, :only => [ :login ] + + before_filter :find_user, :only => [ :change_password ] def login render :inline => "ran action" @@ -125,6 +127,12 @@ class FilterTest < Test::Unit::TestCase def change_password render :inline => "ran action" end + + protected + def find_user + @ran_filter ||= [] + @ran_filter << "find_user" + end end class ConditionalParentOfConditionalSkippingController < ConditionalFilterController @@ -382,7 +390,7 @@ class FilterTest < Test::Unit::TestCase def test_conditional_skipping_of_filters assert_nil test_process(ConditionalSkippingController, "login").template.assigns["ran_filter"] - assert_equal %w( ensure_login ), test_process(ConditionalSkippingController, "change_password").template.assigns["ran_filter"] + assert_equal %w( ensure_login find_user ), test_process(ConditionalSkippingController, "change_password").template.assigns["ran_filter"] assert_nil test_process(ConditionalSkippingController, "login").template.controller.instance_variable_get("@ran_after_filter") assert_equal %w( clean_up ), test_process(ConditionalSkippingController, "change_password").template.controller.instance_variable_get("@ran_after_filter") @@ -392,7 +400,7 @@ class FilterTest < Test::Unit::TestCase assert_equal %w( conditional_in_parent conditional_in_parent ), test_process(ChildOfConditionalParentController).template.assigns['ran_filter'] assert_nil test_process(ChildOfConditionalParentController, 'another_action').template.assigns['ran_filter'] end - + private def test_process(controller, action = "show") request = ActionController::TestRequest.new |