diff options
author | Vasiliy Ermolovich <younash@gmail.com> | 2012-10-20 22:27:43 +0300 |
---|---|---|
committer | Vasiliy Ermolovich <younash@gmail.com> | 2012-10-20 22:35:31 +0300 |
commit | 3ee6bcfc3d3e7be0dd3b76ac929500aaf031f8f9 (patch) | |
tree | b886f74b797900de63945fa74e9438c7cc323e81 /actionpack/test/template | |
parent | bfc6c17a87792012443e7b083e3e86810173c113 (diff) | |
download | rails-3ee6bcfc3d3e7be0dd3b76ac929500aaf031f8f9.tar.gz rails-3ee6bcfc3d3e7be0dd3b76ac929500aaf031f8f9.tar.bz2 rails-3ee6bcfc3d3e7be0dd3b76ac929500aaf031f8f9.zip |
check_box value can be not only an object of Array class
there is a chance that `value` is a Set or an object that reponses to `include?` method so let's handle this case
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/form_helper_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb index 246c4bfada..fbfc73deda 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -400,6 +400,12 @@ class FormHelperTest < ActionView::TestCase '<input name="post[secret]" type="hidden" value="0" /><input checked="checked" id="post_secret" name="post[secret]" type="checkbox" value="1" />', check_box("post", "secret") ) + + @post.secret = Set.new(['1']) + assert_dom_equal( + '<input name="post[secret]" type="hidden" value="0" /><input checked="checked" id="post_secret" name="post[secret]" type="checkbox" value="1" />', + check_box("post", "secret") + ) end def test_check_box_with_include_hidden_false |