class LayoutAutoDiscoveryTest
Public Instance Methods
setup()
click to toggle source
Calls superclass method
# File actionview/test/actionpack/controller/layout_test.rb, line 51 def setup super @request.host = "www.nextangle.com" end
test_application_layout_is_default_when_no_controller_match()
click to toggle source
# File actionview/test/actionpack/controller/layout_test.rb, line 56 def test_application_layout_is_default_when_no_controller_match @controller = ProductController.new get :hello assert_equal "layout_test.erb hello.erb", @response.body end
test_controller_name_layout_name_match()
click to toggle source
# File actionview/test/actionpack/controller/layout_test.rb, line 62 def test_controller_name_layout_name_match @controller = ItemController.new get :hello assert_equal "item.erb hello.erb", @response.body end
test_namespaced_controllers_auto_detect_layouts1()
click to toggle source
# File actionview/test/actionpack/controller/layout_test.rb, line 77 def test_namespaced_controllers_auto_detect_layouts1 @controller = ControllerNameSpace::NestedController.new get :hello assert_equal "controller_name_space/nested.erb hello.erb", @response.body end
test_namespaced_controllers_auto_detect_layouts2()
click to toggle source
# File actionview/test/actionpack/controller/layout_test.rb, line 83 def test_namespaced_controllers_auto_detect_layouts2 @controller = MultipleExtensions.new get :hello assert_equal "multiple_extensions.html.erb hello.erb", @response.body.strip end
test_third_party_template_library_auto_discovers_layout()
click to toggle source
# File actionview/test/actionpack/controller/layout_test.rb, line 68 def test_third_party_template_library_auto_discovers_layout with_template_handler :mab, lambda { |template| template.source.inspect } do @controller = ThirdPartyTemplateLibraryController.new get :hello assert_response :success assert_equal "layouts/third_party_template_library.mab", @response.body end end