aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/test/base/custom_methods_test.rb
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2007-06-21 15:07:15 +0000
committerRick Olson <technoweenie@gmail.com>2007-06-21 15:07:15 +0000
commit9e4461438f8ce584b635aca35579c36537a340ca (patch)
tree8c1b83901b2d7ee52d32eec792e6af1ca807e65f /activeresource/test/base/custom_methods_test.rb
parenteb2e30ef249051713d8122a784d8fbfa378e7ae1 (diff)
downloadrails-9e4461438f8ce584b635aca35579c36537a340ca.tar.gz
rails-9e4461438f8ce584b635aca35579c36537a340ca.tar.bz2
rails-9e4461438f8ce584b635aca35579c36537a340ca.zip
Added proper handling of arrays. Closes #8537 [hasmanyjosh]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7074 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activeresource/test/base/custom_methods_test.rb')
-rw-r--r--activeresource/test/base/custom_methods_test.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/activeresource/test/base/custom_methods_test.rb b/activeresource/test/base/custom_methods_test.rb
index f591c14260..0e1c00c478 100644
--- a/activeresource/test/base/custom_methods_test.rb
+++ b/activeresource/test/base/custom_methods_test.rb
@@ -6,6 +6,7 @@ class CustomMethodsTest < Test::Unit::TestCase
def setup
@matz = { :id => 1, :name => 'Matz' }.to_xml(:root => 'person')
@matz_deep = { :id => 1, :name => 'Matz', :other => 'other' }.to_xml(:root => 'person')
+ @matz_array = [{ :id => 1, :name => 'Matz' }].to_xml(:root => 'people')
@ryan = { :name => 'Ryan' }.to_xml(:root => 'person')
@addy = { :id => 1, :street => '12345 Street' }.to_xml(:root => 'address')
@addy_deep = { :id => 1, :street => '12345 Street', :zip => "27519" }.to_xml(:root => 'address')
@@ -15,8 +16,8 @@ class CustomMethodsTest < Test::Unit::TestCase
mock.get "/people/1.xml", {}, @matz
mock.get "/people/1/shallow.xml", {}, @matz
mock.get "/people/1/deep.xml", {}, @matz_deep
- mock.get "/people/retrieve.xml?name=Matz", {}, "<people>#{@matz}</people>"
- mock.get "/people/managers.xml", {}, "<people>#{@matz}</people>"
+ mock.get "/people/retrieve.xml?name=Matz", {}, @matz_array
+ mock.get "/people/managers.xml", {}, @matz_array
mock.put "/people/1/promote.xml?position=Manager", {}, nil, 204
mock.put "/people/promote.xml?name=Matz", {}, nil, 204, {}
mock.put "/people/sort.xml?by=name", {}, nil, 204