Sha256: ba9036fea0ffe00dc9052f8999b2a54537d2d44a112b96eda28119159fd55df2

Contents?: true

Size: 602 Bytes

Versions: 21

Compression:

Stored size: 602 Bytes

Contents

require 'spec_helper_integration'

class Doorkeeper::OAuth::ClientCredentialsRequest
  describe Creator do
    let(:client) { FactoryGirl.create :application }
    let(:scopes) { Doorkeeper::OAuth::Scopes.from_string('public') }

    it 'creates a new token' do
      expect do
        subject.call(client, scopes)
      end.to change { Doorkeeper::AccessToken.count }.by(1)
    end

    it 'returns false if creation fails' do
      expect(Doorkeeper::AccessToken).to receive(:create).and_return(false)
      created = subject.call(client, scopes)
      expect(created).to be_falsey
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
doorkeeper-3.0.1 spec/lib/oauth/client_credentials/creator_spec.rb
doorkeeper-2.2.2 spec/lib/oauth/client_credentials/creator_spec.rb
doorkeeper-3.0.0 spec/lib/oauth/client_credentials/creator_spec.rb
doorkeeper-3.0.0.rc2 spec/lib/oauth/client_credentials/creator_spec.rb
doorkeeper-3.0.0.rc1 spec/lib/oauth/client_credentials/creator_spec.rb
doorkeeper-2.2.1 spec/lib/oauth/client_credentials/creator_spec.rb
doorkeeper-2.2.0 spec/lib/oauth/client_credentials/creator_spec.rb
doorkeeper-2.1.4 spec/lib/oauth/client_credentials/creator_spec.rb
doorkeeper-1.4.2 spec/lib/oauth/client_credentials/creator_spec.rb
doorkeeper-2.1.3 spec/lib/oauth/client_credentials/creator_spec.rb
doorkeeper-2.1.2 spec/lib/oauth/client_credentials/creator_spec.rb
doorkeeper-2.1.1 spec/lib/oauth/client_credentials/creator_spec.rb
doorkeeper-2.1.0 spec/lib/oauth/client_credentials/creator_spec.rb
doorkeeper-2.0.1 spec/lib/oauth/client_credentials/creator_spec.rb
doorkeeper-1.4.1 spec/lib/oauth/client_credentials/creator_spec.rb
doorkeeper-2.0.0 spec/lib/oauth/client_credentials/creator_spec.rb
doorkeeper-2.0.0.rc3 spec/lib/oauth/client_credentials/creator_spec.rb
doorkeeper-2.0.0.rc2 spec/lib/oauth/client_credentials/creator_spec.rb
doorkeeper-2.0.0.alpha1 spec/lib/oauth/client_credentials/creator_spec.rb
doorkeeper-1.4.0 spec/lib/oauth/client_credentials/creator_spec.rb