diff options
author | pivotal <pivotal@shotwell.flood.pivotallabs.com> | 2009-10-02 13:57:31 -0700 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2009-10-15 10:37:04 +1300 |
commit | 945d999aadc9df41487e675fa0a863396cb54e31 (patch) | |
tree | aa13a8a177c9615f28430440342b4dd145804ca0 /activeresource/test/connection_test.rb | |
parent | 1d01bad3cedfd690c6d125cac6d4504baa9409e5 (diff) | |
download | rails-945d999aadc9df41487e675fa0a863396cb54e31.tar.gz rails-945d999aadc9df41487e675fa0a863396cb54e31.tar.bz2 rails-945d999aadc9df41487e675fa0a863396cb54e31.zip |
Digest auth option for ActiveResource.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
Diffstat (limited to 'activeresource/test/connection_test.rb')
-rw-r--r-- | activeresource/test/connection_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/activeresource/test/connection_test.rb b/activeresource/test/connection_test.rb index 2a3e04272a..a2744d7531 100644 --- a/activeresource/test/connection_test.rb +++ b/activeresource/test/connection_test.rb @@ -225,6 +225,21 @@ class ConnectionTest < Test::Unit::TestCase assert_raise(ActiveResource::SSLError) { @conn.get('/people/1.xml') } end + def test_auth_type_can_be_string + @conn.auth_type = 'digest' + assert_equal(:digest, @conn.auth_type) + end + + def test_auth_type_defaults_to_basic + @conn.auth_type = nil + assert_equal(:basic, @conn.auth_type) + end + + def test_auth_type_ignores_nonsensical_values + @conn.auth_type = :wibble + assert_equal(:basic, @conn.auth_type) + end + protected def assert_response_raises(klass, code) assert_raise(klass, "Expected response code #{code} to raise #{klass}") do |