aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/test/cases
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-05-27 10:57:05 +0200
committerXavier Noria <fxn@hashref.com>2010-05-27 10:57:05 +0200
commitddec74fb3ab66528ca98ff37ca9b5f4227fdd2e3 (patch)
treec58ac9162487bdca68342fb2d30730ccfd926378 /activeresource/test/cases
parent96e2094b8b634e4af0d9d3c8a1db9bbb7023a4a7 (diff)
parente02db06ece7aeecec7c37f5b0e3de7d65c8684e6 (diff)
downloadrails-ddec74fb3ab66528ca98ff37ca9b5f4227fdd2e3.tar.gz
rails-ddec74fb3ab66528ca98ff37ca9b5f4227fdd2e3.tar.bz2
rails-ddec74fb3ab66528ca98ff37ca9b5f4227fdd2e3.zip
Merge remote branch 'rails/master'
Diffstat (limited to 'activeresource/test/cases')
-rw-r--r--activeresource/test/cases/base_test.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/activeresource/test/cases/base_test.rb b/activeresource/test/cases/base_test.rb
index d5ee7659af..35c3f4c6ef 100644
--- a/activeresource/test/cases/base_test.rb
+++ b/activeresource/test/cases/base_test.rb
@@ -1017,7 +1017,7 @@ class BaseTest < Test::Unit::TestCase
encode = matz.encode
xml = matz.to_xml
- assert encode, xml
+ assert_equal encode, xml
assert xml.include?('<?xml version="1.0" encoding="UTF-8"?>')
assert xml.include?('<name>Matz</name>')
assert xml.include?('<id type="integer">1</id>')
@@ -1030,7 +1030,7 @@ class BaseTest < Test::Unit::TestCase
encode = matz.encode
xml = matz.to_xml
- assert encode, xml
+ assert_equal encode, xml
assert xml.include?('<?xml version="1.0" encoding="UTF-8"?>')
assert xml.include?('<ruby-creator>')
assert xml.include?('<name>Matz</name>')
@@ -1065,7 +1065,7 @@ class BaseTest < Test::Unit::TestCase
json = joe.to_json
Person.format = :xml
- assert encode, json
+ assert_equal encode, json
assert_match %r{^\{"ruby_creator":\{"person":\{}, json
assert_match %r{"id":6}, json
assert_match %r{"name":"Joe"}, json
@@ -1081,6 +1081,13 @@ class BaseTest < Test::Unit::TestCase
assert_equal '1', matz.to_param
end
+ def test_to_key_quacks_like_active_record
+ new_person = Person.new
+ assert_nil new_person.to_key
+ matz = Person.find(1)
+ assert_equal [1], matz.to_key
+ end
+
def test_parse_deep_nested_resources
luis = Customer.find(1)
assert_kind_of Customer, luis