test/test_http.rb in atom-tools-1.0.0 vs test/test_http.rb in atom-tools-2.0.0
- old
+ new
@@ -252,9 +252,27 @@
@http.token = TOKEN
assert_authenticates
end
+ def test_multiple_auth
+ mount_one_shot do |req,res|
+ # WEBrick doesn't seem to support sending multiple headers, so this is the best we can do
+ res["WWW-Authenticate"] = %{NonexistantAuth parameter="yes", qop="auth", Basic realm="#{REALM}", something="true"}
+
+ if req["Authorization"]
+ res.body = SECRET_DATA
+ else
+ res.status = 401
+ end
+ end
+
+ @http.user = USER
+ @http.pass = PASS
+
+ assert_authenticates
+ end
+
def test_https
require 'webrick/https'
@s = WEBrick::HTTPServer.new(
:Port => (@port + 1),