Sha256: c2ecdfb90620a84740180ed19f077064ec22462ffa0ee976e3681638bc7b43e5

Contents?: true

Size: 868 Bytes

Versions: 13

Compression:

Stored size: 868 Bytes

Contents

require 'spec_helper_integration'

describe Doorkeeper::AccessGrant do
  subject { FactoryBot.build(:access_grant) }

  it { expect(subject).to be_valid }

  it_behaves_like 'an accessible token'
  it_behaves_like 'a revocable token'
  it_behaves_like 'a unique token' do
    let(:factory_name) { :access_grant }
  end

  describe 'validations' do
    it 'is invalid without resource_owner_id' do
      subject.resource_owner_id = nil
      expect(subject).not_to be_valid
    end

    it 'is invalid without application_id' do
      subject.application_id = nil
      expect(subject).not_to be_valid
    end

    it 'is invalid without token' do
      subject.save
      subject.token = nil
      expect(subject).not_to be_valid
    end

    it 'is invalid without expires_in' do
      subject.expires_in = nil
      expect(subject).not_to be_valid
    end
  end
end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
doorkeeper-mongodb-4.2.0 spec/models/doorkeeper/access_grant_spec.rb
doorkeeper-sequel-1.5.0 spec/models/doorkeeper/access_grant_spec.rb
doorkeeper-4.4.3 spec/models/doorkeeper/access_grant_spec.rb
doorkeeper-4.4.2 spec/models/doorkeeper/access_grant_spec.rb
doorkeeper-4.4.1 spec/models/doorkeeper/access_grant_spec.rb
doorkeeper-4.4.0 spec/models/doorkeeper/access_grant_spec.rb
doorkeeper-mongodb-4.1.0 spec/models/doorkeeper/access_grant_spec.rb
doorkeeper-4.3.2 spec/models/doorkeeper/access_grant_spec.rb
doorkeeper-4.3.1 spec/models/doorkeeper/access_grant_spec.rb
doorkeeper-4.3.0 spec/models/doorkeeper/access_grant_spec.rb
doorkeeper-sequel-1.4.0 spec/models/doorkeeper/access_grant_spec.rb
doorkeeper-mongodb-4.0.1 spec/models/doorkeeper/access_grant_spec.rb
doorkeeper-mongodb-4.0.0 spec/models/doorkeeper/access_grant_spec.rb