aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2017-03-29 12:40:57 -0400
committerRafael Mendonça França <rafaelmfranca@gmail.com>2017-03-29 12:40:57 -0400
commit862cc0bfbe6f125aff4e76c2d71764a14bcf4891 (patch)
treed3035c1f2e0b232dc6d893cd701744787cfefc94 /actionpack/test/controller
parenta680a5814184e2f37c4686aa53d0ad3c7fb6b1ee (diff)
downloadrails-862cc0bfbe6f125aff4e76c2d71764a14bcf4891.tar.gz
rails-862cc0bfbe6f125aff4e76c2d71764a14bcf4891.tar.bz2
rails-862cc0bfbe6f125aff4e76c2d71764a14bcf4891.zip
Add test to make sure subclasses also get helpers
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/api/with_helpers_test.rb16
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