diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2010-08-27 01:16:27 -0300 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2010-08-27 09:08:04 -0300 |
commit | f95ba5c262bfd713f0a2fc656f8e645d3eea60f2 (patch) | |
tree | fc91e39178da1031d307fa14f54e66b772d52721 /actionpack/test | |
parent | f98694b624749488d9cc6ff6829d437df4bca1bf (diff) | |
download | rails-f95ba5c262bfd713f0a2fc656f8e645d3eea60f2.tar.gz rails-f95ba5c262bfd713f0a2fc656f8e645d3eea60f2.tar.bz2 rails-f95ba5c262bfd713f0a2fc656f8e645d3eea60f2.zip |
Make InstanceTagMethods#value_before_type_cast raise if the model don't respond to attr_before_type_cast or attr method
[#3374] [#5471 state:committed]
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/form_helper_test.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb index 71a5ae0245..8ba4aa1639 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -12,6 +12,8 @@ class FormHelperTest < ActionView::TestCase def name "Santiago" end + + attr_writer :language end def form_for(*) @@ -257,6 +259,17 @@ class FormHelperTest < ActionView::TestCase ) end + def test_text_field_on_a_model_with_undefined_attr_reader + @developer = Developer.new + @developer.language = 'ruby' + begin + text_field("developer", "language") + rescue NoMethodError => error + message = error.message + end + assert_equal "Model #{Developer} does not respond to language", message + end + def test_check_box assert_dom_equal( '<input name="post[secret]" type="hidden" value="0" /><input checked="checked" id="post_secret" name="post[secret]" type="checkbox" value="1" />', |