From 08736788c906d2b05fe6c45e6922e594149c9b12 Mon Sep 17 00:00:00 2001 From: Rick Olson Date: Wed, 9 May 2007 03:51:06 +0000 Subject: 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 --- activeresource/test/base_test.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activeresource/test') 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 -- cgit v1.2.3