Sha256: 92d2833f991b4d4d1686eadaa27e3830eb431dd9b8de70b7401be015205e204f

Contents?: true

Size: 799 Bytes

Versions: 7

Compression:

Stored size: 799 Bytes

Contents

require 'spec_helper'

describe Devise::Oauth2Providable::AuthorizationCode do
  describe 'basic authorization code instance' do
    with :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 allow_mass_assignment_of :user }
    it { should belong_to :client }
    it { should allow_mass_assignment_of :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

7 entries across 7 versions & 4 rubygems

Version Path
devise_oauth2_rails4-1.1.2 spec/models/authorization_code_spec.rb
mustwin_devise_oauth2_providable-1.1.6 spec/models/authorization_code_spec.rb
mustwin_devise_oauth2_providable-1.1.5 spec/models/authorization_code_spec.rb
mustwin_devise_oauth2_providable-1.1.4 spec/models/authorization_code_spec.rb
mustwin_devise_oauth2_providable-1.1.3 spec/models/authorization_code_spec.rb
insrc_devise_oauth2_providable-1.1.2 spec/models/authorization_code_spec.rb
devise_oauth2_providable-1.1.2 spec/models/authorization_code_spec.rb