Namespace
Methods
- C
- S
- T
-
- test_all_helpers,
- test_all_helpers_with_alternate_helper_dir,
- test_base_helper_methods_after_clear_helpers,
- test_default_helpers_only,
- test_helper,
- test_helper_attr,
- test_helper_for_acronym_controller,
- test_helper_for_nested_controller,
- test_helper_method,
- test_helper_proxy,
- test_helper_proxy_config,
- test_helper_proxy_in_instance,
- test_lib_helper_methods_after_clear_helpers
Instance Public methods
call_controller(klass, action)
Link
setup()
Link
# File actionpack/test/controller/helper_test.rb, line 107 def setup # Increment symbol counter. @symbol = (@@counter ||= 'A0').succ!.dup # Generate new controller class. controller_class_name = "Helper#{@symbol}Controller" eval("class #{controller_class_name} < TestController; end") @controller_class = self.class.const_get(controller_class_name) # Set default test helper. self.test_helper = LocalAbcHelper end
test_all_helpers()
Link
# File actionpack/test/controller/helper_test.rb, line 167 def test_all_helpers methods = AllHelpersController._helpers.instance_methods # abc_helper.rb assert methods.include?(:bare_a) # fun/games_helper.rb assert methods.include?(:stratego) # fun/pdf_helper.rb assert methods.include?(:foobar) end
test_all_helpers_with_alternate_helper_dir()
Link
# File actionpack/test/controller/helper_test.rb, line 180 def test_all_helpers_with_alternate_helper_dir @controller_class.helpers_path = File.expand_path('../../fixtures/alternate_helpers', __FILE__) # Reload helpers @controller_class._helpers = Module.new @controller_class.helper :all # helpers/abc_helper.rb should not be included assert !master_helper_methods.include?(:bare_a) # alternate_helpers/foo_helper.rb assert master_helper_methods.include?(:baz) end
test_base_helper_methods_after_clear_helpers()
Link
test_default_helpers_only()
Link
# File actionpack/test/controller/helper_test.rb, line 150 def test_default_helpers_only assert_equal [JustMeHelper], JustMeController._helpers.ancestors.reject(&:anonymous?) assert_equal [MeTooHelper, JustMeHelper], MeTooController._helpers.ancestors.reject(&:anonymous?) end
test_helper()
Link
test_helper_attr()
Link
test_helper_for_acronym_controller()
Link
test_helper_for_nested_controller()
Link
test_helper_method()
Link
test_helper_proxy()
Link
# File actionpack/test/controller/helper_test.rb, line 194 def test_helper_proxy methods = AllHelpersController.helpers.methods # Action View assert methods.include?(:pluralize) # abc_helper.rb assert methods.include?(:bare_a) # fun/games_helper.rb assert methods.include?(:stratego) # fun/pdf_helper.rb assert methods.include?(:foobar) end
test_helper_proxy_config()
Link
test_helper_proxy_in_instance()
Link
# File actionpack/test/controller/helper_test.rb, line 210 def test_helper_proxy_in_instance methods = AllHelpersController.new.helpers.methods # Action View assert_includes methods, :pluralize # abc_helper.rb assert_includes methods, :bare_a # fun/games_helper.rb assert_includes methods, :stratego # fun/pdf_helper.rb assert_includes methods, :foobar end