spec/httpi/adapter/curb_spec.rb in httpi-2.0.2 vs spec/httpi/adapter/curb_spec.rb in httpi-2.1.0
- old
+ new
@@ -166,10 +166,19 @@
curb.expects(:verbose=).with(false)
adapter.request(:get)
end
end
+ describe "NTLM authentication" do
+ it "is not supported" do
+ request.auth.ntlm("tester", "vReqSoafRe5O")
+
+ expect { adapter.request(:get) }.
+ to raise_error(HTTPI::NotSupportedError, /does not support NTLM authentication/)
+ end
+ end
+
describe "http_auth_types" do
it "is set to :basic for HTTP basic auth" do
request.auth.basic "username", "password"
curb.expects(:http_auth_types=).with(:basic)
@@ -213,9 +222,17 @@
let(:request) do
request = HTTPI::Request.new("http://example.com")
request.auth.ssl.cert_key_file = "spec/fixtures/client_key.pem"
request.auth.ssl.cert_file = "spec/fixtures/client_cert.pem"
request
+ end
+
+ it "send certificate regardless of state of SSL verify mode" do
+ request.auth.ssl.verify_mode = :none
+ curb.expects(:cert_key=).with(request.auth.ssl.cert_key_file)
+ curb.expects(:cert=).with(request.auth.ssl.cert_file)
+
+ adapter.request(:get)
end
it "cert_key, cert and ssl_verify_peer should be set" do
curb.expects(:cert_key=).with(request.auth.ssl.cert_key_file)
curb.expects(:cert=).with(request.auth.ssl.cert_file)