Sha256: fd4d92c9fcb470c1f27abb13f33f798461a53d156272cfc4e77f8d672116bc50

Contents?: true

Size: 719 Bytes

Versions: 4

Compression:

Stored size: 719 Bytes

Contents

require 'spec_helper'

describe Devise::Oauth2Providable::AuthorizationCode do
  describe 'basic authorization code instance' do
    let(:client) { create(:client) }
    subject do
      Devise::Oauth2Providable::AuthorizationCode.create! :client => client
    end
    it { should validate_presence_of :token }
    it { should validate_uniqueness_of :token }
    it { should belong_to :user }
    it { should belong_to :client }
    it { should validate_presence_of :client }
    it { should validate_presence_of :expires_at }
    it { should have_db_index :client_id }
    it { should have_db_index :user_id }
    it { should have_db_index(:token).unique(true) }
    it { should have_db_index :expires_at }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
anjlab-devise-oauth2-providable-1.1.3 spec/models/authorization_code_spec.rb
anjlab-devise-oauth2-providable-1.1.2 spec/models/authorization_code_spec.rb
anjlab-devise-oauth2-providable-1.1.1 spec/models/authorization_code_spec.rb
anjlab-devise-oauth2-providable-1.1.0 spec/models/authorization_code_spec.rb