aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/filters_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2007-10-21 18:58:17 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2007-10-21 18:58:17 +0000
commitf777ff72f931983946cbccbf2c64270922e93d84 (patch)
tree8f68287ad1788989553d337c82e73449d25c1ec8 /actionpack/test/controller/filters_test.rb
parent7042163d7633c1d453bcbed127d42ea27da6b939 (diff)
downloadrails-f777ff72f931983946cbccbf2c64270922e93d84.tar.gz
rails-f777ff72f931983946cbccbf2c64270922e93d84.tar.bz2
rails-f777ff72f931983946cbccbf2c64270922e93d84.zip
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
Diffstat (limited to 'actionpack/test/controller/filters_test.rb')
-rw-r--r--actionpack/test/controller/filters_test.rb10
1 files changed, 6 insertions, 4 deletions
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