Permalink
Browse files

Added test for case when view doesn't have logger method when using A…

…ctionController::Metal controller.
  • Loading branch information...
1 parent 2ab9ff5 commit e8f9e667e46242cf64e50487385aaa6504359df1 @route route committed Jun 15, 2012
Showing with 17 additions and 0 deletions.
  1. +17 −0 actionpack/test/controller/render_test.rb
@@ -724,6 +724,14 @@ def determine_layout
end
end
+class MetalTestController < ActionController::Metal
+ include ActionController::Rendering
+
+ def accessing_logger_in_template
+ render :inline => "<%= logger.class %>"
+ end
+end
+
class RenderTest < ActionController::TestCase
tests TestController
@@ -1605,3 +1613,12 @@ def test_last_modified_works_with_less_than_too
assert_response :success
end
end
+
+class MetalRenderTest < ActionController::TestCase
+ tests MetalTestController
+
+ def test_access_to_logger_in_view
+ get :accessing_logger_in_template
+ assert_equal "NilClass", @response.body
+ end
+end

0 comments on commit e8f9e66

Please sign in to comment.