diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2017-03-29 12:40:57 -0400 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2017-03-29 12:40:57 -0400 |
commit | 862cc0bfbe6f125aff4e76c2d71764a14bcf4891 (patch) | |
tree | d3035c1f2e0b232dc6d893cd701744787cfefc94 | |
parent | a680a5814184e2f37c4686aa53d0ad3c7fb6b1ee (diff) | |
download | rails-862cc0bfbe6f125aff4e76c2d71764a14bcf4891.tar.gz rails-862cc0bfbe6f125aff4e76c2d71764a14bcf4891.tar.bz2 rails-862cc0bfbe6f125aff4e76c2d71764a14bcf4891.zip |
Add test to make sure subclasses also get helpers
-rw-r--r-- | actionpack/test/controller/api/with_helpers_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
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 |