Sha256: d1492c49f934bd214fb1837baf97ea648168b35d47a83e0aa723972d492637ed

Contents?: true

Size: 637 Bytes

Versions: 14

Compression:

Stored size: 637 Bytes

Contents

require 'spec_helper'

RSpec.describe RDStation::Authorization do
  
  describe ".initialize" do
    context "when access_token is nil" do
      it "raises an error" do
        expect do
          described_class.new(access_token: nil)
        end.to raise_error(ArgumentError)
      end
    end
  end
  
  describe "#headers" do
    let(:access_token) { 'access_token' }
    
    it "generates the correct header" do
      header = described_class.new(access_token: access_token).headers
      expect(header['Authorization']).to eq "Bearer #{access_token}"
      expect(header['Content-Type']).to eq "application/json"
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rdstation-ruby-client-2.9.0 spec/lib/rdstation/authorization_spec.rb
rdstation-ruby-client-2.8.2 spec/lib/rdstation/authorization_spec.rb
rdstation-ruby-client-2.8.1 spec/lib/rdstation/authorization_spec.rb
rdstation-ruby-client-2.8.0 spec/lib/rdstation/authorization_spec.rb
rdstation-ruby-client-2.7.0 spec/lib/rdstation/authorization_spec.rb
rdstation-ruby-client-2.6.0 spec/lib/rdstation/authorization_spec.rb
rdstation-ruby-client-2.5.3 spec/lib/rdstation/authorization_spec.rb
rdstation-ruby-client-2.5.2 spec/lib/rdstation/authorization_spec.rb
rdstation-ruby-client-2.5.1 spec/lib/rdstation/authorization_spec.rb
rdstation-ruby-client-2.5.0 spec/lib/rdstation/authorization_spec.rb
rdstation-ruby-client-2.4.0 spec/lib/rdstation/authorization_spec.rb
rdstation-ruby-client-2.3.1 spec/lib/rdstation/authorization_spec.rb
rdstation-ruby-client-2.3.0 spec/lib/rdstation/authorization_spec.rb
rdstation-ruby-client-2.2.0 spec/lib/rdstation/authorization_spec.rb