Skip to content
This repository
Browse code

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

…ctionController::Metal controller.
  • Loading branch information...
commit 4717c2ffc6c2416cfbf5fb560689606eadd3b3c6 1 parent 3b1ea3d
Dmitry Vorotilin authored

Showing 1 changed file with 17 additions and 0 deletions. Show diff stats Hide diff stats

  1. 17  actionpack/test/controller/render_test.rb
17  actionpack/test/controller/render_test.rb
@@ -718,6 +718,14 @@ def determine_layout
718 718
     end
719 719
 end
720 720
 
  721
+class MetalTestController < ActionController::Metal
  722
+  include ActionController::Rendering
  723
+
  724
+  def accessing_logger_in_template
  725
+    render :inline =>  "<%= logger.class %>"
  726
+  end
  727
+end
  728
+
721 729
 class RenderTest < ActionController::TestCase
722 730
   tests TestController
723 731
 
@@ -1583,3 +1591,12 @@ def test_last_modified_works_with_less_than_too
1583 1591
     assert_response :success
1584 1592
   end
1585 1593
 end
  1594
+
  1595
+class MetalRenderTest < ActionController::TestCase
  1596
+  tests MetalTestController
  1597
+
  1598
+  def test_access_to_logger_in_view
  1599
+    get :accessing_logger_in_template
  1600
+    assert_equal "NilClass", @response.body
  1601
+  end
  1602
+end

0 notes on commit 4717c2f

Please sign in to comment.
Something went wrong with that request. Please try again.