Sha256: 2512e8f9f329f09f594005d2f6adf184acb15a0475150579dfe25749a4dbac09
Contents?: true
Size: 828 Bytes
Versions: 19
Compression:
Stored size: 828 Bytes
Contents
require_relative '../test_helper' require_relative '../../lib/faraday/connection' module Faraday describe Connection do describe 'digest_auth' do let(:connection) do Faraday.new('http://api.example.org/') do |builder| builder.request :url_encoded builder.adapter :net_http end end it 'inserts the DigestAuth middleware at the top' do connection.digest_auth('user', 'password') connection.builder.handlers.first.klass.must_equal Faraday::Request::DigestAuth end it 'passes the user and password to the middleware' do connection.digest_auth('user', 'password') Faraday::Request::DigestAuth.expects(:new).with(anything, 'user', 'password').returns(stub_everything) connection.get('/') end end end end
Version data entries
19 entries across 19 versions & 1 rubygems