Sha256: fc5b2015352e785002773e8be462e26cacb0ddd1d9b3200791049816ace2d9e9

Contents?: true

Size: 658 Bytes

Versions: 15

Compression:

Stored size: 658 Bytes

Contents

require 'spec_helper'
require 'gds-sso/api_access'

describe GDS::SSO::ApiAccess do
  it "should not consider IE7 accept header as an api call" do
    ie7_accept_header = 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, ' +
      'application/x-shockwave-flash, application/xaml+xml, application/x-ms-xbap, ' +
      'application/x-ms-application, */*'
    expect(GDS::SSO::ApiAccess.api_call?('HTTP_ACCEPT' => ie7_accept_header)).to be_falsey
  end

  context "with a bearer token" do
    it "it is considered an api call" do
      expect(GDS::SSO::ApiAccess.api_call?('HTTP_AUTHORIZATION' => 'Bearer deadbeef12345678')).to be_truthy
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
gds-sso-15.0.0 spec/unit/api_access_spec.rb
gds-sso-14.3.0 spec/unit/api_access_spec.rb
gds-sso-14.2.0 spec/unit/api_access_spec.rb
gds-sso-14.1.1 spec/unit/api_access_spec.rb
gds-sso-14.1.0 spec/unit/api_access_spec.rb
gds-sso-14.0.0 spec/unit/api_access_spec.rb
gds-sso-13.6.0 spec/unit/api_access_spec.rb
gds-sso-13.5.1 spec/unit/api_access_spec.rb
gds-sso-13.5.0 spec/unit/api_access_spec.rb
gds-sso-13.4.0 spec/unit/api_access_spec.rb
gds-sso-13.3.0 spec/unit/api_access_spec.rb
gds-sso-13.2.1 spec/unit/api_access_spec.rb
gds-sso-13.2.0 spec/unit/api_access_spec.rb
gds-sso-13.1.0 spec/unit/api_access_spec.rb
gds-sso-13.0.0 spec/unit/api_access_spec.rb