aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test
diff options
context:
space:
mode:
authorTobias Pfeiffer <tobias.pfeiffer@student.hpi.uni-potsdam.de>2014-02-24 17:05:42 +0100
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-10-31 16:33:42 -0200
commitf0570a3d3fa85ba0153d61c90bad6db648144256 (patch)
tree3015b5ed5456653d003705f9ffbcba6ca8c85f8f /actionview/test
parentecb31131fb7c917baa9d53fde3021fb037861808 (diff)
downloadrails-f0570a3d3fa85ba0153d61c90bad6db648144256.tar.gz
rails-f0570a3d3fa85ba0153d61c90bad6db648144256.tar.bz2
rails-f0570a3d3fa85ba0153d61c90bad6db648144256.zip
Honor public/private in ActionView::Helpers::Tags::Base#value
* use public_send instead of send to avoid calling private methods in form helpers
Diffstat (limited to 'actionview/test')
-rw-r--r--actionview/test/template/form_helper_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/actionview/test/template/form_helper_test.rb b/actionview/test/template/form_helper_test.rb
index f2238d1443..36e3e64688 100644
--- a/actionview/test/template/form_helper_test.rb
+++ b/actionview/test/template/form_helper_test.rb
@@ -158,6 +158,12 @@ class FormHelperTest < ActionView::TestCase
assert_raise(NotImplementedError) { FooTag.new.render }
end
+ def test_tags_base_value_honors_public_private
+ test_object = Class.new { private def my_method ; end }.new
+ tag = ActionView::Helpers::Tags::Base.new 'test_object', :my_method, nil
+ assert_raise(NoMethodError) { tag.send :value, test_object }
+ end
+
def test_label
assert_dom_equal('<label for="post_title">Title</label>', label("post", "title"))
assert_dom_equal(