diff options
author | Josh Kalderimis <josh.kalderimis@gmail.com> | 2011-05-17 19:50:34 -0400 |
---|---|---|
committer | Josh Kalderimis <josh.kalderimis@gmail.com> | 2011-05-18 00:34:10 -0400 |
commit | 00958696d871da3126113be70bb858d078b86ab5 (patch) | |
tree | 6e4ce7a5389a171cf2be8d11de5aefa6e2bcc4cf /activeresource/test/cases/authorization_test.rb | |
parent | b641ab5baec0956c0135e7341ca238eff3f9d5a5 (diff) | |
download | rails-00958696d871da3126113be70bb858d078b86ab5.tar.gz rails-00958696d871da3126113be70bb858d078b86ab5.tar.bz2 rails-00958696d871da3126113be70bb858d078b86ab5.zip |
corrected some further tests and docs for the ARes change to json change
Diffstat (limited to 'activeresource/test/cases/authorization_test.rb')
-rw-r--r-- | activeresource/test/cases/authorization_test.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/activeresource/test/cases/authorization_test.rb b/activeresource/test/cases/authorization_test.rb index cf23f10b76..69ef9a2821 100644 --- a/activeresource/test/cases/authorization_test.rb +++ b/activeresource/test/cases/authorization_test.rb @@ -48,7 +48,7 @@ class AuthorizationTest < Test::Unit::TestCase end def test_authorization_header - authorization_header = @authenticated_conn.__send__(:authorization_header, :get, URI.parse('/people/2.xml')) + authorization_header = @authenticated_conn.__send__(:authorization_header, :get, URI.parse('/people/2.json')) assert_equal @basic_authorization_request_header['Authorization'], authorization_header['Authorization'] authorization = authorization_header["Authorization"].to_s.split @@ -58,7 +58,7 @@ class AuthorizationTest < Test::Unit::TestCase def test_authorization_header_with_username_but_no_password @conn = ActiveResource::Connection.new("http://david:@localhost") - authorization_header = @conn.__send__(:authorization_header, :get, URI.parse('/people/2.xml')) + authorization_header = @conn.__send__(:authorization_header, :get, URI.parse('/people/2.json')) authorization = authorization_header["Authorization"].to_s.split assert_equal "Basic", authorization[0] @@ -67,7 +67,7 @@ class AuthorizationTest < Test::Unit::TestCase def test_authorization_header_with_password_but_no_username @conn = ActiveResource::Connection.new("http://:test123@localhost") - authorization_header = @conn.__send__(:authorization_header, :get, URI.parse('/people/2.xml')) + authorization_header = @conn.__send__(:authorization_header, :get, URI.parse('/people/2.json')) authorization = authorization_header["Authorization"].to_s.split assert_equal "Basic", authorization[0] @@ -76,7 +76,7 @@ class AuthorizationTest < Test::Unit::TestCase def test_authorization_header_with_decoded_credentials_from_url @conn = ActiveResource::Connection.new("http://my%40email.com:%31%32%33@localhost") - authorization_header = @conn.__send__(:authorization_header, :get, URI.parse('/people/2.xml')) + authorization_header = @conn.__send__(:authorization_header, :get, URI.parse('/people/2.json')) authorization = authorization_header["Authorization"].to_s.split assert_equal "Basic", authorization[0] @@ -87,7 +87,7 @@ class AuthorizationTest < Test::Unit::TestCase @authenticated_conn = ActiveResource::Connection.new("http://@localhost") @authenticated_conn.user = 'david' @authenticated_conn.password = 'test123' - authorization_header = @authenticated_conn.__send__(:authorization_header, :get, URI.parse('/people/2.xml')) + authorization_header = @authenticated_conn.__send__(:authorization_header, :get, URI.parse('/people/2.json')) assert_equal @basic_authorization_request_header['Authorization'], authorization_header['Authorization'] authorization = authorization_header["Authorization"].to_s.split @@ -98,7 +98,7 @@ class AuthorizationTest < Test::Unit::TestCase def test_authorization_header_explicitly_setting_username_but_no_password @conn = ActiveResource::Connection.new("http://@localhost") @conn.user = "david" - authorization_header = @conn.__send__(:authorization_header, :get, URI.parse('/people/2.xml')) + authorization_header = @conn.__send__(:authorization_header, :get, URI.parse('/people/2.json')) authorization = authorization_header["Authorization"].to_s.split assert_equal "Basic", authorization[0] @@ -108,7 +108,7 @@ class AuthorizationTest < Test::Unit::TestCase def test_authorization_header_explicitly_setting_password_but_no_username @conn = ActiveResource::Connection.new("http://@localhost") @conn.password = "test123" - authorization_header = @conn.__send__(:authorization_header, :get, URI.parse('/people/2.xml')) + authorization_header = @conn.__send__(:authorization_header, :get, URI.parse('/people/2.json')) authorization = authorization_header["Authorization"].to_s.split assert_equal "Basic", authorization[0] @@ -117,7 +117,7 @@ class AuthorizationTest < Test::Unit::TestCase def test_authorization_header_if_credentials_supplied_and_auth_type_is_basic @authenticated_conn.auth_type = :basic - authorization_header = @authenticated_conn.__send__(:authorization_header, :get, URI.parse('/people/2.xml')) + authorization_header = @authenticated_conn.__send__(:authorization_header, :get, URI.parse('/people/2.json')) assert_equal @basic_authorization_request_header['Authorization'], authorization_header['Authorization'] authorization = authorization_header["Authorization"].to_s.split |