Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #6777 from route/logger_in_metal_tests

Added test for case when view doesn't have logger method when using 
ActionController::Metal controller.
  • Loading branch information...
commit 4d69cdbdd75f5a9594055099770c4c3d0ffeb98d 2 parents 23c5894 + e8f9e66
@carlosantoniodasilva carlosantoniodasilva authored
Showing with 17 additions and 0 deletions.
  1. +17 −0 actionpack/test/controller/render_test.rb
View
17 actionpack/test/controller/render_test.rb
@@ -730,6 +730,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
@@ -1617,3 +1625,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
Please sign in to comment.
Something went wrong with that request. Please try again.