aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/validations_test.rb
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2006-04-21 17:04:00 +0000
committerJamis Buck <jamis@37signals.com>2006-04-21 17:04:00 +0000
commit010a10f3a115602a40c6ad4b502f1158c9d40161 (patch)
treed0c31bca8d6db8f67458bbe811a3685908e78aed /activerecord/test/validations_test.rb
parent1f80f540a7618e0d9c853319f6488e25ac201b2c (diff)
downloadrails-010a10f3a115602a40c6ad4b502f1158c9d40161.tar.gz
rails-010a10f3a115602a40c6ad4b502f1158c9d40161.tar.bz2
rails-010a10f3a115602a40c6ad4b502f1158c9d40161.zip
Add ActiveRecord::Errors#to_xml
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4243 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/validations_test.rb')
-rwxr-xr-xactiverecord/test/validations_test.rb9
1 files changed, 9 insertions, 0 deletions
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 "<errors>", xml.first(8)
+ assert xml.include?("<error>Title is Wrong Create</error>")
+ assert xml.include?("<error>Content Empty</error>")
+ end
end