diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-10 03:50:00 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-10 03:50:00 +0000 |
commit | 3442e0c6714d766b9ea0ca2fc644fdf7753832aa (patch) | |
tree | e5eb45c589a0e4ff340dea0c5e2e3d0700b52274 /activerecord/test | |
parent | db37c0c95fea1ddb3a34665f82d3cba9bced49f8 (diff) | |
download | rails-3442e0c6714d766b9ea0ca2fc644fdf7753832aa.tar.gz rails-3442e0c6714d766b9ea0ca2fc644fdf7753832aa.tar.bz2 rails-3442e0c6714d766b9ea0ca2fc644fdf7753832aa.zip |
Added options to control the :only/:except for included associations on Base#to_xml [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3832 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-rwxr-xr-x | activerecord/test/base_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/activerecord/test/base_test.rb b/activerecord/test/base_test.rb index 3ad2d6e960..ba2c3130bf 100755 --- a/activerecord/test/base_test.rb +++ b/activerecord/test/base_test.rb @@ -1202,6 +1202,17 @@ class BasicsTest < Test::Unit::TestCase assert xml.include?(%(<account>)) assert xml.include?(%(<clients><client>)) end + + def test_to_xml_including_multiple_associations_with_options + xml = companies(:first_firm).to_xml( + :indent => 0, :skip_instruct => true, + :include => { :clients => { :only => :name } } + ) + + assert_equal "<firm>", xml.first(6) + assert xml.include?(%(<client><name>Summit</name></client>)) + assert xml.include?(%(<clients><client>)) + end def test_except_attributes assert_equal( |