From 862cc0bfbe6f125aff4e76c2d71764a14bcf4891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Wed, 29 Mar 2017 12:40:57 -0400 Subject: Add test to make sure subclasses also get helpers --- actionpack/test/controller/api/with_helpers_test.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/controller/api/with_helpers_test.rb b/actionpack/test/controller/api/with_helpers_test.rb index 9882a25ae1..06db949153 100644 --- a/actionpack/test/controller/api/with_helpers_test.rb +++ b/actionpack/test/controller/api/with_helpers_test.rb @@ -15,6 +15,12 @@ class WithHelpersController < ActionController::API end end +class SubclassWithHelpersController < WithHelpersController + def with_helpers + render plain: self.class.helpers.my_helper + end +end + class WithHelpersTest < ActionController::TestCase tests WithHelpersController @@ -24,3 +30,13 @@ class WithHelpersTest < ActionController::TestCase assert_equal "helper", response.body end end + +class SubclassWithHelpersTest < ActionController::TestCase + tests WithHelpersController + + def test_with_helpers + get :with_helpers + + assert_equal "helper", response.body + end +end -- cgit v1.2.3