diff options
Diffstat (limited to 'activerecord/test')
-rwxr-xr-x | activerecord/test/base_test.rb | 6 | ||||
-rwxr-xr-x | activerecord/test/fixtures/company.rb | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/base_test.rb b/activerecord/test/base_test.rb index 2f834772a6..4ccc2c8588 100755 --- a/activerecord/test/base_test.rb +++ b/activerecord/test/base_test.rb @@ -1273,6 +1273,12 @@ class BasicsTest < Test::Unit::TestCase assert xml.include?(%(<clients><client>)) end + def test_to_xml_including_methods + xml = Company.new.to_xml(:methods => :arbitrary_method, :skip_instruct => true) + assert_equal "<company>", xml.first(9) + assert xml.include?(%(<arbitrary-method>I am Jack's profound disappointment</arbitrary-method>)) + end + def test_except_attributes assert_equal( %w( author_name type id approved replies_count bonus_time written_on content author_email_address parent_id last_read), diff --git a/activerecord/test/fixtures/company.rb b/activerecord/test/fixtures/company.rb index 526748784e..250deebb21 100755 --- a/activerecord/test/fixtures/company.rb +++ b/activerecord/test/fixtures/company.rb @@ -5,6 +5,10 @@ class Company < ActiveRecord::Base validates_presence_of :name has_one :dummy_account, :foreign_key => "firm_id", :class_name => "Account" + + def arbitrary_method + "I am Jack's profound disappointment" + end end |