diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2006-10-09 06:11:40 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2006-10-09 06:11:40 +0000 |
commit | eaae0399ad205c8d5afa3130b07f4c31e0c04aac (patch) | |
tree | 5bec9fe79a6ec55888c62531c66a439b95ac1b47 /actionpack/test/controller | |
parent | 850087f0bd691568690ca9d3169c88c0f3ad7c3b (diff) | |
download | rails-eaae0399ad205c8d5afa3130b07f4c31e0c04aac.tar.gz rails-eaae0399ad205c8d5afa3130b07f4c31e0c04aac.tar.bz2 rails-eaae0399ad205c8d5afa3130b07f4c31e0c04aac.zip |
r5540@ks: jeremy | 2006-10-08 23:05:30 -0700
#5949
r5541@ks: jeremy | 2006-10-08 23:07:08 -0700
Fix filter skipping in controller subclasses.
r5557@ks: jeremy | 2006-10-08 23:11:24 -0700
Update changelog. Closes #5949, references #6297, references #6299.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5268 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/filters_test.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/actionpack/test/controller/filters_test.rb b/actionpack/test/controller/filters_test.rb index 421758ac34..a098840486 100644 --- a/actionpack/test/controller/filters_test.rb +++ b/actionpack/test/controller/filters_test.rb @@ -154,7 +154,7 @@ class FilterTest < Test::Unit::TestCase @ran_filter << "find_user" end end - + class ConditionalParentOfConditionalSkippingController < ConditionalFilterController before_filter :conditional_in_parent, :only => [:show, :another_action] after_filter :conditional_in_parent, :only => [:show, :another_action] @@ -172,6 +172,10 @@ class FilterTest < Test::Unit::TestCase skip_after_filter :conditional_in_parent, :only => :another_action end + class AnotherChildOfConditionalParentController < ConditionalParentOfConditionalSkippingController + skip_before_filter :conditional_in_parent, :only => :show + end + class ProcController < PrependingController before_filter(proc { |c| c.assigns["ran_proc_filter"] = true }) end @@ -413,6 +417,12 @@ class FilterTest < Test::Unit::TestCase assert_nil test_process(ChildOfConditionalParentController, 'another_action').template.assigns['ran_filter'] end + def test_condition_skipping_of_filters_when_siblings_also_have_conditions + assert_equal %w( conditional_in_parent conditional_in_parent ), test_process(ChildOfConditionalParentController).template.assigns['ran_filter'], "1" + assert_equal nil, test_process(AnotherChildOfConditionalParentController).template.assigns['ran_filter'] + assert_equal %w( conditional_in_parent conditional_in_parent ), test_process(ChildOfConditionalParentController).template.assigns['ran_filter'] + end + private def test_process(controller, action = "show") request = ActionController::TestRequest.new |