aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/test/base_test.rb
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2007-05-09 03:51:06 +0000
committerRick Olson <technoweenie@gmail.com>2007-05-09 03:51:06 +0000
commit08736788c906d2b05fe6c45e6922e594149c9b12 (patch)
tree40430c567a1662a958ee78aa230b5c1431dc4fdb /activeresource/test/base_test.rb
parent2b6ad48ea3c80e693b3c92f90432c790c8ee1510 (diff)
downloadrails-08736788c906d2b05fe6c45e6922e594149c9b12.tar.gz
rails-08736788c906d2b05fe6c45e6922e594149c9b12.tar.bz2
rails-08736788c906d2b05fe6c45e6922e594149c9b12.zip
Handle string and symbol param keys when splitting params into prefix params and query params.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6703 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activeresource/test/base_test.rb')
-rw-r--r--activeresource/test/base_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activeresource/test/base_test.rb b/activeresource/test/base_test.rb
index e9bf5d70b3..db02cc2716 100644
--- a/activeresource/test/base_test.rb
+++ b/activeresource/test/base_test.rb
@@ -109,10 +109,12 @@ class BaseTest < Test::Unit::TestCase
def test_custom_element_path
assert_equal '/people/1/addresses/1.xml', StreetAddress.element_path(1, :person_id => 1)
+ assert_equal '/people/1/addresses/1.xml', StreetAddress.element_path(1, 'person_id' => 1)
end
def test_custom_element_path_with_parameters
assert_equal '/people/1/addresses/1.xml?type=work', StreetAddress.element_path(1, :person_id => 1, :type => 'work')
+ assert_equal '/people/1/addresses/1.xml?type=work', StreetAddress.element_path(1, 'person_id' => 1, :type => 'work')
assert_equal '/people/1/addresses/1.xml?type=work', StreetAddress.element_path(1, :type => 'work', :person_id => 1)
assert_equal '/people/1/addresses/1.xml?type%5B%5D=work&type%5B%5D=play+time', StreetAddress.element_path(1, :person_id => 1, :type => ['work', 'play time'])
end
@@ -123,10 +125,12 @@ class BaseTest < Test::Unit::TestCase
def test_custom_collection_path
assert_equal '/people/1/addresses.xml', StreetAddress.collection_path(:person_id => 1)
+ assert_equal '/people/1/addresses.xml', StreetAddress.collection_path('person_id' => 1)
end
def test_custom_collection_path_with_parameters
assert_equal '/people/1/addresses.xml?type=work', StreetAddress.collection_path(:person_id => 1, :type => 'work')
+ assert_equal '/people/1/addresses.xml?type=work', StreetAddress.collection_path('person_id' => 1, :type => 'work')
end
def test_custom_collection_path_with_prefix_and_parameters