diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-03-07 08:50:50 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-03-07 08:50:50 -0800 |
commit | 9cee693213e0205cb5992728bb516215e34cb79f (patch) | |
tree | 097e97b585521c6d3eb7ae0d2e80b95c26603980 /actionpack/test/template/form_options_helper_test.rb | |
parent | 09d3e89cf0b3e7be03f97739e297fd40ebba1178 (diff) | |
parent | 2159e9eb64fd47635c84097e93f8708018e87751 (diff) | |
download | rails-9cee693213e0205cb5992728bb516215e34cb79f.tar.gz rails-9cee693213e0205cb5992728bb516215e34cb79f.tar.bz2 rails-9cee693213e0205cb5992728bb516215e34cb79f.zip |
Merge branch 'master' of github.com:rails/rails
* 'master' of github.com:rails/rails: (44 commits)
Fixed indentation in actionmailer base_test [#6538 state:committed]
remove unused assigned variable
removes merge conflicts
removes Examples headers introduced in 9b96de6
Revert "Fixed identation in actionmailer base_test"
Report the correct value of nil.id in the exception message as different ruby implementations may have different values, for example Rubinius returns 53 for nil.id.
Improve testing of cookies in functional tests: - cookies can be set using string or symbol keys - cookies are preserved across calls to get, post, etc. - cookie names and values are escaped - cookies can be cleared using @request.cookies.clear
more style changes
Some style changes
style changes
Revert "style changes"
Raise ArgumentError if route name is invalid [#6517 state:resolved]
style changes
Allow model to be inherited from Hash [#6487 state:resolved]
styles applied for usage
added failing test for fields_for with a record object that inherits from Hash
Fixed identation in actionmailer base_test
wrong SQL statement
commas to set off expressions that interrupt sentence flow
typo changes
...
Diffstat (limited to 'actionpack/test/template/form_options_helper_test.rb')
-rw-r--r-- | actionpack/test/template/form_options_helper_test.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/actionpack/test/template/form_options_helper_test.rb b/actionpack/test/template/form_options_helper_test.rb index 69b1d4ff7b..93ff7ba0fd 100644 --- a/actionpack/test/template/form_options_helper_test.rb +++ b/actionpack/test/template/form_options_helper_test.rb @@ -1,6 +1,12 @@ require 'abstract_unit' require 'tzinfo' +class Map < Hash + def category + "<mus>" + end +end + TZInfo::Timezone.cattr_reader :loaded_zones class FormOptionsHelperTest < ActionView::TestCase @@ -394,6 +400,19 @@ class FormOptionsHelperTest < ActionView::TestCase ) end + def test_fields_for_with_record_inherited_from_hash + map = Map.new + + output_buffer = fields_for :map, map do |f| + concat f.select(:category, %w( abe <mus> hest)) + end + + assert_dom_equal( + "<select id=\"map_category\" name=\"map[category]\"><option value=\"abe\">abe</option>\n<option value=\"<mus>\" selected=\"selected\"><mus></option>\n<option value=\"hest\">hest</option></select>", + output_buffer + ) + end + def test_select_under_fields_for_with_index @post = Post.new @post.category = "<mus>" |