diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2006-09-02 21:00:09 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2006-09-02 21:00:09 +0000 |
commit | d0696d764189996422c3dea649c388b7685a10e5 (patch) | |
tree | e0f6245dc606ecbff957317a4279a4dac9fadaba /activerecord/test/base_test.rb | |
parent | ad63005cdd4260b225f097ebde4fa80a36f84729 (diff) | |
download | rails-d0696d764189996422c3dea649c388b7685a10e5.tar.gz rails-d0696d764189996422c3dea649c388b7685a10e5.tar.bz2 rails-d0696d764189996422c3dea649c388b7685a10e5.zip |
to_xml: the :methods option works on arrays of records. Closes #5845.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4909 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/base_test.rb')
-rwxr-xr-x | activerecord/test/base_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/base_test.rb b/activerecord/test/base_test.rb index b917e43278..18c5b50006 100755 --- a/activerecord/test/base_test.rb +++ b/activerecord/test/base_test.rb @@ -1340,6 +1340,12 @@ class BasicsTest < Test::Unit::TestCase xml = [ topics(:first), topics(:second) ].to_xml(:indent => 0, :skip_instruct => true, :include => :replies) assert xml.include?(%(<replies><reply>)) end + + def test_array_to_xml_including_methods + xml = [ topics(:first), topics(:second) ].to_xml(:indent => 0, :skip_instruct => true, :methods => [ :topic_id ]) + assert xml.include?(%(<topic-id type="integer">#{topics(:first).topic_id}</topic-id>)) + assert xml.include?(%(<topic-id type="integer">#{topics(:second).topic_id}</topic-id>)) + end def test_array_to_xml_including_has_one_association xml = [ companies(:first_firm), companies(:rails_core) ].to_xml(:indent => 0, :skip_instruct => true, :include => :account) |