Sha256: b9becf2519818b59b10aca8c1a3716f53a684a39b05d1f0da894ed1cb82cb794

Contents?: true

Size: 554 Bytes

Versions: 11

Compression:

Stored size: 554 Bytes

Contents

require 'rest-core/test'

describe RC::Universal do
  should 'send Authorization header' do
    u = RC::Universal.new(:log_method => false)
    u.username = 'Aladdin'
    u.password = 'open sesame'

    u.request_full({}, u.dry)[RC::REQUEST_HEADERS].should.eq(
      {'Authorization' => 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='})

    acc = {'Accept' => 'text/plain'}
    env = {RC::REQUEST_HEADERS => acc}

    u.request_full(env, u.dry)[RC::REQUEST_HEADERS].should.eq(
      {'Authorization' => 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='}.merge(acc))
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rest-core-3.1.1 test/test_universal.rb
rest-core-3.1.0 test/test_universal.rb
rest-core-3.0.0 test/test_universal.rb
rest-core-2.1.2 test/test_universal.rb
rest-core-2.1.1 test/test_universal.rb
rest-core-2.1.0 test/test_universal.rb
rest-core-2.0.4 test/test_universal.rb
rest-core-2.0.3 test/test_universal.rb
rest-core-2.0.2 test/test_universal.rb
rest-core-2.0.1 test/test_universal.rb
rest-core-2.0.0 test/test_universal.rb