Use assert_match instead of String#include? so we can get helpful error messages on failure

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6668 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Michael Koziarski
2007-05-06 02:03:46 +00:00
parent 4cbbebb1c3
commit e642368829

View File

@@ -146,6 +146,8 @@ class DatabaseConnectedXmlSerializationTest < Test::Unit::TestCase
def test_include_uses_association_name
xml = authors(:david).to_xml :include=>:hello_posts, :indent=>0
assert(xml.include?(%(<hello_posts><post>)) || xml.include?(%(</post></hello-posts>)))
assert_match %r{<hello-posts>}, xml
assert_match %r{<post>}, xml
assert_match %r{<sti-post>}, xml
end
end