aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/test/base_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activeresource/test/base_test.rb')
-rw-r--r--activeresource/test/base_test.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/activeresource/test/base_test.rb b/activeresource/test/base_test.rb
index a1051e5875..f97b08295a 100644
--- a/activeresource/test/base_test.rb
+++ b/activeresource/test/base_test.rb
@@ -181,7 +181,7 @@ class BaseTest < Test::Unit::TestCase
def test_prefix
assert_equal "/", Person.prefix
- assert_equal Set.new, Person.send(:prefix_parameters)
+ assert_equal Set.new, Person.send!(:prefix_parameters)
end
def test_set_prefix
@@ -208,7 +208,7 @@ class BaseTest < Test::Unit::TestCase
def test_custom_prefix
assert_equal '/people//', StreetAddress.prefix
assert_equal '/people/1/', StreetAddress.prefix(:person_id => 1)
- assert_equal [:person_id].to_set, StreetAddress.send(:prefix_parameters)
+ assert_equal [:person_id].to_set, StreetAddress.send!(:prefix_parameters)
end
def test_find_by_id
@@ -305,10 +305,10 @@ class BaseTest < Test::Unit::TestCase
def test_id_from_response
p = Person.new
resp = {'Location' => '/foo/bar/1'}
- assert_equal '1', p.send(:id_from_response, resp)
+ assert_equal '1', p.send!(:id_from_response, resp)
resp['Location'] << '.xml'
- assert_equal '1', p.send(:id_from_response, resp)
+ assert_equal '1', p.send!(:id_from_response, resp)
end
def test_create_with_custom_prefix
@@ -439,6 +439,9 @@ class BaseTest < Test::Unit::TestCase
def test_to_xml
matz = Person.find(1)
- assert_equal "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<person>\n <name>Matz</name>\n <id type=\"integer\">1</id>\n</person>\n", matz.to_xml
+ xml = matz.to_xml
+ assert xml.starts_with?('<?xml version="1.0" encoding="UTF-8"?>')
+ assert xml.include?('<name>Matz</name>')
+ assert xml.include?('<id type="integer">1</id>')
end
end