Sha256: b014b15abdfa4ca35404bb090c7704c25eedf2d60ab07aa072c3a3e8a8d60cff

Contents?: true

Size: 790 Bytes

Versions: 32

Compression:

Stored size: 790 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

32 entries across 32 versions & 2 rubygems

Version Path
doorkeeper-sequel-1.2.1 spec/lib/oauth/invalid_token_response_spec.rb
doorkeeper-4.2.0 spec/lib/oauth/invalid_token_response_spec.rb
doorkeeper-4.1.0 spec/lib/oauth/invalid_token_response_spec.rb
doorkeeper-4.0.0 spec/lib/oauth/invalid_token_response_spec.rb
doorkeeper-4.0.0.rc4 spec/lib/oauth/invalid_token_response_spec.rb
doorkeeper-4.0.0.rc3 spec/lib/oauth/invalid_token_response_spec.rb
doorkeeper-4.0.0.rc2 spec/lib/oauth/invalid_token_response_spec.rb
doorkeeper-4.0.0.rc1 spec/lib/oauth/invalid_token_response_spec.rb
doorkeeper-3.1.0 spec/lib/oauth/invalid_token_response_spec.rb
doorkeeper-3.0.1 spec/lib/oauth/invalid_token_response_spec.rb
doorkeeper-2.2.2 spec/lib/oauth/invalid_token_response_spec.rb
doorkeeper-3.0.0 spec/lib/oauth/invalid_token_response_spec.rb
doorkeeper-3.0.0.rc2 spec/lib/oauth/invalid_token_response_spec.rb
doorkeeper-3.0.0.rc1 spec/lib/oauth/invalid_token_response_spec.rb
doorkeeper-2.2.1 spec/lib/oauth/invalid_token_response_spec.rb
doorkeeper-2.2.0 spec/lib/oauth/invalid_token_response_spec.rb
doorkeeper-2.1.4 spec/lib/oauth/invalid_token_response_spec.rb
doorkeeper-1.4.2 spec/lib/oauth/invalid_token_response_spec.rb
doorkeeper-2.1.3 spec/lib/oauth/invalid_token_response_spec.rb
doorkeeper-2.1.2 spec/lib/oauth/invalid_token_response_spec.rb