From b451de0d6de4df6bc66b274cec73b919f823d5ae Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sat, 14 Aug 2010 02:13:00 -0300 Subject: Deletes trailing whitespaces (over text files only find * -type f -exec sed 's/[ \t]*$//' -i {} \;) --- activeresource/test/cases/base/custom_methods_test.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'activeresource/test/cases/base') diff --git a/activeresource/test/cases/base/custom_methods_test.rb b/activeresource/test/cases/base/custom_methods_test.rb index 2d81549a65..459d33c24f 100644 --- a/activeresource/test/cases/base/custom_methods_test.rb +++ b/activeresource/test/cases/base/custom_methods_test.rb @@ -35,7 +35,7 @@ class CustomMethodsTest < Test::Unit::TestCase Person.user = nil Person.password = nil - end + end def teardown ActiveResource::HttpMock.reset! @@ -64,13 +64,13 @@ class CustomMethodsTest < Test::Unit::TestCase # Test GET against an element URL assert_equal Person.find(1).get(:shallow), {"id" => 1, "name" => 'Matz'} assert_equal Person.find(1).get(:deep), {"id" => 1, "name" => 'Matz', "other" => 'other'} - + # Test PUT against an element URL assert_equal ActiveResource::Response.new("", 204, {}), Person.find(1).put(:promote, {:position => 'Manager'}, 'body') - + # Test DELETE against an element URL assert_equal ActiveResource::Response.new("", 200, {}), Person.find(1).delete(:deactivate) - + # With nested resources assert_equal StreetAddress.find(1, :params => { :person_id => 1 }).get(:deep), { "id" => 1, "street" => '12345 Street', "zip" => "27519" } @@ -87,7 +87,7 @@ class CustomMethodsTest < Test::Unit::TestCase # Test POST against a nested collection URL addy = StreetAddress.new(:street => '123 Test Dr.', :person_id => 1) - assert_equal ActiveResource::Response.new({ :street => '12345 Street' }.to_xml(:root => 'address'), + assert_equal ActiveResource::Response.new({ :street => '12345 Street' }.to_xml(:root => 'address'), 201, {'Location' => '/people/1/addresses/2.xml'}), addy.post(:link) -- cgit v1.2.3