Sha256: 8e351a8dcdb13db8d99e06b8f602b44617028b6a829e445b7d92fdc6fa5bd76c

Contents?: true

Size: 620 Bytes

Versions: 1

Compression:

Stored size: 620 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_false
  end

  it "should consider a json accept header to be an api call" do
    expect(GDS::SSO::ApiAccess.api_call?('HTTP_ACCEPT' => 'application/json')).to be_true
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gds-sso-12.1.0 spec/unit/api_access_spec.rb