Sha256: 4bcd54412d1393ed6040ed9bde0edb28a3283df9b219b4cbc9a99a5c383197b0

Contents?: true

Size: 802 Bytes

Versions: 2

Compression:

Stored size: 802 Bytes

Contents

require 'spec_helper'
require 'active_model'
require 'doorkeeper'
require 'doorkeeper/oauth/invalid_token_response'

module Doorkeeper::OAuth
  describe InvalidTokenResponse do
    describe '#name' do
      it  { expect(subject.name).to eq(:invalid_token) }
    end

    describe '#status' do
      it { expect(subject.status).to eq(:unauthorized) }
    end

    describe :from_access_token do
      it 'revoked' do
        response = InvalidTokenResponse.from_access_token double(:revoked? => true, :expired? => true)
        expect(response.description).to include("revoked")
      end

      it 'expired' do
        response = InvalidTokenResponse.from_access_token double(:revoked? => false, :expired? => true)
        expect(response.description).to include("expired")
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
doorkeeper-1.1.0 spec/lib/oauth/invalid_token_response_spec.rb
doorkeeper-1.0.0 spec/lib/oauth/invalid_token_response_spec.rb