Sha256: 96ca5604d4c66fb94d43e59f3d05767a888d56825eccceb3748c19750915d39c

Contents?: true

Size: 556 Bytes

Versions: 4

Compression:

Stored size: 556 Bytes

Contents

require 'spec_helper'
require 'napa/authentication'

describe Napa::Authentication do
  context '#password_header' do
    it "returns a password hash for the request header" do
      ENV['HEADER_PASSWORD'] = 'foo'
      expect(Napa::Authentication.password_header.class).to eq(Hash)
      expect(Napa::Authentication.password_header).to eq('Password' => 'foo')
    end

    it 'raises when the HEADER_PASSWORD env var is not defined' do
      ENV['HEADER_PASSWORD'] = nil
      expect{Napa::Authentication.password_header}.to raise_error
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
napa-0.5.0 spec/authentication_spec.rb
napa-0.4.3 spec/authentication_spec.rb
napa-0.4.1 spec/authentication_spec.rb
napa-0.4.0 spec/authentication_spec.rb