- B
- S
- T
Source: show
# File rails/actionpack/test/controller/helper_test.rb, line 86 def block_helper_method; end
Source: show
# File rails/actionpack/test/controller/helper_test.rb, line 34 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) # Generate new template class and assign to controller. template_class_name = "Test#{@symbol}View" eval("class #{template_class_name} < ActionView::Base; end") @template_class = self.class.const_get(template_class_name) @controller_class.template_class = @template_class # Set default test helper. self.test_helper = LocalAbcHelper end
Source: show
# File rails/actionpack/test/controller/helper_test.rb, line 53 def teardown # Reset template class. #ActionController::Base.template_class = ActionView::Base end
Source: show
# File rails/actionpack/test/controller/helper_test.rb, line 65 def test_declare_helper require 'abc_helper' self.test_helper = AbcHelper assert_equal expected_helper_methods, missing_methods assert_nothing_raised { @controller_class.helper :abc } assert_equal [], missing_methods end
Source: show
# File rails/actionpack/test/controller/helper_test.rb, line 78 def test_declare_missing_file_from_helper require 'broken_helper' rescue LoadError => e assert_nil(%r\bbroken_helper\b/.match(e.to_s)[1]) end
Source: show
# File rails/actionpack/test/controller/helper_test.rb, line 73 def test_declare_missing_helper assert_equal expected_helper_methods, missing_methods assert_raise(MissingSourceFile) { @controller_class.helper :missing } end
Source: show
# File rails/actionpack/test/controller/helper_test.rb, line 59 def test_deprecated_helper assert_equal expected_helper_methods, missing_methods assert_nothing_raised { @controller_class.helper TestHelper } assert_equal [], missing_methods end
Source: show
# File rails/actionpack/test/controller/helper_test.rb, line 104 def test_helper_attr assert_nothing_raised { @controller_class.helper_attr :delegate_attr } assert master_helper_methods.include?('delegate_attr') assert master_helper_methods.include?('delegate_attr=') end
Source: show
# File rails/actionpack/test/controller/helper_test.rb, line 84 def test_helper_block assert_nothing_raised { @controller_class.helper { def block_helper_method; end } } assert master_helper_methods.include?('block_helper_method') end
Source: show
# File rails/actionpack/test/controller/helper_test.rb, line 91 def test_helper_block_include assert_equal expected_helper_methods, missing_methods assert_nothing_raised { @controller_class.helper { include TestHelper } } assert [], missing_methods end
Source: show
# File rails/actionpack/test/controller/helper_test.rb, line 118 def test_helper_for_acronym_controller request = ActionController::TestRequest.new response = ActionController::TestResponse.new request.action = 'test' assert_equal 'test: baz', Fun::PDFController.process(request, response).body end
Source: show
# File rails/actionpack/test/controller/helper_test.rb, line 110 def test_helper_for_nested_controller request = ActionController::TestRequest.new response = ActionController::TestResponse.new request.action = 'render_hello_world' assert_equal 'hello: Iz guuut!', Fun::GamesController.process(request, response).body end
Source: show
# File rails/actionpack/test/controller/helper_test.rb, line 99 def test_helper_method assert_nothing_raised { @controller_class.helper_method :delegate_method } assert master_helper_methods.include?('delegate_method') end