class AbstractController::Testing::TestHelpers

Public Instance Methods

setup() click to toggle source
# File actionview/test/actionpack/abstract/helper_test.rb, line 62
def setup
  @controller = AbstractHelpers.new
end
test_declare_missing_helper() click to toggle source
# File actionview/test/actionpack/abstract/helper_test.rb, line 81
def test_declare_missing_helper
  e = assert_raise AbstractController::Helpers::MissingHelperError do
    AbstractHelpers.helper :missing
  end
  assert_equal "helpers/missing_helper.rb", e.path
end
test_helpers_with_block() click to toggle source
# File actionview/test/actionpack/abstract/helper_test.rb, line 66
def test_helpers_with_block
  @controller.process(:with_block)
  assert_equal "Hello World", @controller.response_body
end
test_helpers_with_module() click to toggle source
# File actionview/test/actionpack/abstract/helper_test.rb, line 71
def test_helpers_with_module
  @controller.process(:with_module)
  assert_equal "Module Included", @controller.response_body
end
test_helpers_with_module_through_block() click to toggle source
# File actionview/test/actionpack/abstract/helper_test.rb, line 88
def test_helpers_with_module_through_block
  @controller = AbstractHelpersBlock.new
  @controller.process(:with_module)
  assert_equal "Module Included", @controller.response_body
end
test_helpers_with_symbol() click to toggle source
# File actionview/test/actionpack/abstract/helper_test.rb, line 76
def test_helpers_with_symbol
  @controller.process(:with_symbol)
  assert_equal "I respond to bare_a: true", @controller.response_body
end