提交 a01d2a25 编写于 作者: J Jeremy Kemper

Remove gratuitous filter_chain internal testing. Not part of the API and other...

Remove gratuitous filter_chain internal testing. Not part of the API and other tests are sufficient to catch regressions.
上级 444480c9
require 'abstract_unit'
# FIXME: crashes Ruby 1.9
class FilterTest < Test::Unit::TestCase
include ActionController::TestProcess
......@@ -141,14 +140,6 @@ class ConditionalOptionsFilter < ConditionalFilterController
before_filter :clean_up_tmp, :if => Proc.new { |c| false }
end
class EmptyFilterChainController < TestController
self.filter_chain.clear
def show
@action_executed = true
render :text => "yawp!"
end
end
class PrependingController < TestController
prepend_before_filter :wonderful_life
# skip_before_filter :fire_flash
......@@ -455,12 +446,6 @@ def test_after_filters_are_not_run_if_around_filter_does_not_yield
assert_equal ["filter_one", "zomg it didn't yield"], controller.assigns['filters']
end
def test_empty_filter_chain
assert_equal 0, EmptyFilterChainController.filter_chain.size
test_process(EmptyFilterChainController)
assert @controller.template.assigns['action_executed']
end
def test_added_filter_to_inheritance_graph
assert_equal [ :ensure_login ], TestController.before_filters
end
......@@ -614,7 +599,6 @@ def test_dynamic_dispatch
end
def test_running_prepended_before_and_after_filter
assert_equal 3, PrependingBeforeAndAfterController.filter_chain.length
test_process(PrependingBeforeAndAfterController)
assert_equal %w( before_all between_before_all_and_after_all after_all ), @controller.template.assigns["ran_filter"]
end
......@@ -818,15 +802,6 @@ class YieldingAroundFiltersTest < Test::Unit::TestCase
include PostsController::AroundExceptions
include ActionController::TestProcess
def test_filters_registering
assert_equal 1, ControllerWithFilterMethod.filter_chain.size
assert_equal 1, ControllerWithFilterClass.filter_chain.size
assert_equal 1, ControllerWithFilterInstance.filter_chain.size
assert_equal 3, ControllerWithSymbolAsFilter.filter_chain.size
assert_equal 6, ControllerWithNestedFilters.filter_chain.size
assert_equal 4, ControllerWithAllTypesOfFilters.filter_chain.size
end
def test_base
controller = PostsController
assert_nothing_raised { test_process(controller,'no_raise') }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册