Sha256: bea0a5ec4e3266298c5cbe224e553f3ccfa8190d674b1c59269585733f428ae2

Contents?: true

Size: 869 Bytes

Versions: 15

Compression:

Stored size: 869 Bytes

Contents

require 'spec_helper_integration'

describe Doorkeeper::AccessGrant do
  subject { FactoryGirl.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

15 entries across 15 versions & 2 rubygems

Version Path
doorkeeper-sequel-1.3.1 spec/models/doorkeeper/access_grant_spec.rb
doorkeeper-sequel-1.3.0 spec/models/doorkeeper/access_grant_spec.rb
doorkeeper-sequel-1.2.3 spec/models/doorkeeper/access_grant_spec.rb
doorkeeper-sequel-1.2.2 spec/models/doorkeeper/access_grant_spec.rb
doorkeeper-4.2.6 spec/models/doorkeeper/access_grant_spec.rb
doorkeeper-4.2.5 spec/models/doorkeeper/access_grant_spec.rb
doorkeeper-sequel-1.2.1 spec/models/doorkeeper/access_grant_spec.rb
doorkeeper-4.2.0 spec/models/doorkeeper/access_grant_spec.rb
doorkeeper-4.1.0 spec/models/doorkeeper/access_grant_spec.rb
doorkeeper-4.0.0 spec/models/doorkeeper/access_grant_spec.rb
doorkeeper-4.0.0.rc4 spec/models/doorkeeper/access_grant_spec.rb
doorkeeper-4.0.0.rc3 spec/models/doorkeeper/access_grant_spec.rb
doorkeeper-4.0.0.rc2 spec/models/doorkeeper/access_grant_spec.rb
doorkeeper-4.0.0.rc1 spec/models/doorkeeper/access_grant_spec.rb
doorkeeper-3.1.0 spec/models/doorkeeper/access_grant_spec.rb