From f777ff72f931983946cbccbf2c64270922e93d84 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 21 Oct 2007 18:58:17 +0000 Subject: Changed before_filter halting to happen automatically on render or redirect but no longer on simply returning false [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7984 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/controller/filters_test.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'actionpack/test/controller/filters_test.rb') diff --git a/actionpack/test/controller/filters_test.rb b/actionpack/test/controller/filters_test.rb index 0a081f5b92..5b77757aee 100644 --- a/actionpack/test/controller/filters_test.rb +++ b/actionpack/test/controller/filters_test.rb @@ -44,7 +44,9 @@ class FilterTest < Test::Unit::TestCase (1..3).each do |i| define_method "try_#{i}" do instance_variable_set :@try, i - action_name != "fail_#{i}" + if action_name == "fail_#{i}" + head(404) + end end end end @@ -823,7 +825,7 @@ class YieldingAroundFiltersTest < Test::Unit::TestCase def test_first_filter_in_multiple_before_filter_chain_halts controller = ::FilterTest::TestMultipleFiltersController.new response = test_process(controller, 'fail_1') - assert_equal '', response.body + assert_equal ' ', response.body assert_equal 1, controller.instance_variable_get(:@try) assert controller.instance_variable_get(:@before_filter_chain_aborted) end @@ -831,7 +833,7 @@ class YieldingAroundFiltersTest < Test::Unit::TestCase def test_second_filter_in_multiple_before_filter_chain_halts controller = ::FilterTest::TestMultipleFiltersController.new response = test_process(controller, 'fail_2') - assert_equal '', response.body + assert_equal ' ', response.body assert_equal 2, controller.instance_variable_get(:@try) assert controller.instance_variable_get(:@before_filter_chain_aborted) end @@ -839,7 +841,7 @@ class YieldingAroundFiltersTest < Test::Unit::TestCase def test_last_filter_in_multiple_before_filter_chain_halts controller = ::FilterTest::TestMultipleFiltersController.new response = test_process(controller, 'fail_3') - assert_equal '', response.body + assert_equal ' ', response.body assert_equal 3, controller.instance_variable_get(:@try) assert controller.instance_variable_get(:@before_filter_chain_aborted) end -- cgit v1.2.3