Sha256: c71943ab860fa92fa7475e6a7e20edbe3cbc5dd60c0fa3cf45b6adb8b35181d8

Contents?: true

Size: 985 Bytes

Versions: 13

Compression:

Stored size: 985 Bytes

Contents

require 'spec_helper'
describe Auth0::Api::V2::Blacklists do
  before :all do
    dummy_instance = DummyClass.new
    dummy_instance.extend(Auth0::Api::V2::Blacklists)
    @instance = dummy_instance
  end

  context '.blacklisted_tokens' do
    it { expect(@instance).to respond_to(:blacklisted_tokens) }
    it 'is expected to call /api/v2/blacklists/tokens' do
      expect(@instance).to receive(:get).with('/api/v2/blacklists/tokens', { aud: nil })
      expect { @instance.blacklisted_tokens }.not_to raise_error
    end
  end

  context '.add_token.to_blacklist' do
    it { expect(@instance).to respond_to(:add_token_to_blacklist) }
    it 'is expected to call post to /api/v2/blacklists/tokens' do
      expect(@instance).to receive(:post).with('/api/v2/blacklists/tokens', { aud: 'aud', jti: 'jti' })
      @instance.add_token_to_blacklist('jti', 'aud')
    end
    it { expect { @instance.add_token_to_blacklist('', '') }.to raise_error 'Must specify a valid JTI' }
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
auth0-5.16.0 spec/lib/auth0/api/v2/blacklists_spec.rb
auth0-5.15.0 spec/lib/auth0/api/v2/blacklists_spec.rb
auth0-5.14.2 spec/lib/auth0/api/v2/blacklists_spec.rb
auth0-5.14.1 spec/lib/auth0/api/v2/blacklists_spec.rb
auth0-5.14.0 spec/lib/auth0/api/v2/blacklists_spec.rb
auth0-5.13.0 spec/lib/auth0/api/v2/blacklists_spec.rb
auth0-5.12.0 spec/lib/auth0/api/v2/blacklists_spec.rb
auth0-5.11.0 spec/lib/auth0/api/v2/blacklists_spec.rb
auth0-5.10.0 spec/lib/auth0/api/v2/blacklists_spec.rb
auth0-5.9.0 spec/lib/auth0/api/v2/blacklists_spec.rb
auth0-5.8.1 spec/lib/auth0/api/v2/blacklists_spec.rb
auth0-5.8.0 spec/lib/auth0/api/v2/blacklists_spec.rb
auth0-5.7.0 spec/lib/auth0/api/v2/blacklists_spec.rb