From 010a10f3a115602a40c6ad4b502f1158c9d40161 Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Fri, 21 Apr 2006 17:04:00 +0000 Subject: Add ActiveRecord::Errors#to_xml git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4243 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/validations_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'activerecord/test/validations_test.rb') diff --git a/activerecord/test/validations_test.rb b/activerecord/test/validations_test.rb index b73058a64b..6ef455459b 100755 --- a/activerecord/test/validations_test.rb +++ b/activerecord/test/validations_test.rb @@ -995,6 +995,15 @@ class ValidationsTest < Test::Unit::TestCase r.topic = Topic.find :first assert r.valid? end + + def test_errors_to_xml + r = Reply.new :title => "Wrong Create" + assert !r.valid? + xml = r.errors.to_xml(:skip_instruct => true) + assert_equal "", xml.first(8) + assert xml.include?("Title is Wrong Create") + assert xml.include?("Content Empty") + end end -- cgit v1.2.3