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_lib_helper_methods_after_clear_helpers
Instance Public methods
call_controller(klass, action)
Link
setup()
Link
# File actionpack/test/controller/helper_test.rb, line 66 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 137 def test_all_helpers methods = AllHelpersController._helpers.instance_methods.map {|m| m.to_s} # 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 150 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 120 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
# File actionpack/test/controller/helper_test.rb, line 110 def test_helper_for_acronym_controller assert_equal "test: baz", call_controller(Fun::PdfController, "test").last.body # # request = ActionController::TestRequest.new # response = ActionController::TestResponse.new # request.action = 'test' # # assert_equal 'test: baz', Fun::PdfController.process(request, response).body end
test_helper_for_nested_controller()
Link
# File actionpack/test/controller/helper_test.rb, line 101 def test_helper_for_nested_controller assert_equal 'hello: Iz guuut!', call_controller(Fun::GamesController, "render_hello_world").last.body # request = ActionController::TestRequest.new # # resp = Fun::GamesController.action(:render_hello_world).call(request.env) # assert_equal 'hello: Iz guuut!', resp.last.body end
test_helper_method()
Link
test_helper_proxy()
Link
# File actionpack/test/controller/helper_test.rb, line 164 def test_helper_proxy methods = AllHelpersController.helpers.methods.map(&:to_s) # 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