Sha256: 8fa2ac1f6487b3129c8116a0a301ee4e07a96e61115c57a2dfbcbc5851de7ffc

Contents?: true

Size: 593 Bytes

Versions: 5

Compression:

Stored size: 593 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
      Doorkeeper::AccessToken.should_receive(:create).and_return(false)
      created = subject.call(client, scopes)
      created.should be_false
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
doorkeeper-1.0.0.rc2 spec/lib/oauth/client_credentials/creator_spec.rb
doorkeeper-1.0.0.rc1 spec/lib/oauth/client_credentials/creator_spec.rb
doorkeeper-0.7.4 spec/lib/oauth/client_credentials/creator_spec.rb
doorkeeper-0.7.3 spec/lib/oauth/client_credentials/creator_spec.rb
doorkeeper-0.7.2 spec/lib/oauth/client_credentials/creator_spec.rb