Skip to content

Commit e8f9e66

Browse files
committed
Added test for case when view doesn't have logger method when using ActionController::Metal controller.
1 parent 2ab9ff5 commit e8f9e66

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

actionpack/test/controller/render_test.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,14 @@ def determine_layout
724724
end
725725
end
726726

727+
class MetalTestController < ActionController::Metal
728+
include ActionController::Rendering
729+
730+
def accessing_logger_in_template
731+
render :inline => "<%= logger.class %>"
732+
end
733+
end
734+
727735
class RenderTest < ActionController::TestCase
728736
tests TestController
729737

@@ -1605,3 +1613,12 @@ def test_last_modified_works_with_less_than_too
16051613
assert_response :success
16061614
end
16071615
end
1616+
1617+
class MetalRenderTest < ActionController::TestCase
1618+
tests MetalTestController
1619+
1620+
def test_access_to_logger_in_view
1621+
get :accessing_logger_in_template
1622+
assert_equal "NilClass", @response.body
1623+
end
1624+
end

0 commit comments

Comments
 (0)