Sha256: 263ee1c3088eaec9d06dbd03f9ad0bf257de1c2519f67c0d590c858a950d5a56

Contents?: true

Size: 828 Bytes

Versions: 3

Compression:

Stored size: 828 Bytes

Contents

require 'spec_helper'

describe Devise::Oauth2Providable::AuthorizationCode do
  describe 'basic authorization code instance' do
    subject do
      client = Devise::Oauth2Providable::Client.create! :name => 'test', :redirect_uri => 'http://localhost:3000', :website => 'http://localhost'
      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

3 entries across 3 versions & 1 rubygems

Version Path
devise_oauth2_providable-1.0.1 spec/models/authorization_code_spec.rb
devise_oauth2_providable-1.0.0 spec/models/authorization_code_spec.rb
devise_oauth2_providable-1.0.0.beta1 spec/models/authorization_code_spec.rb