Sha256: 55727d9f91837c8842473dd986bca662930299b6c651ec1e3afe10bfdc717695

Contents?: true

Size: 851 Bytes

Versions: 10

Compression:

Stored size: 851 Bytes

Contents

require 'spec_helper'

describe Devise::Oauth2Providable::RefreshToken do
  it { Devise::Oauth2Providable::RefreshToken.table_name.should == 'oauth2_refresh_tokens' }

  describe 'basic refresh token instance' do
    let(:client) { FactoryGirl.create :client }
    subject do
      Devise::Oauth2Providable::RefreshToken.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_many :access_tokens }
    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

10 entries across 10 versions & 1 rubygems

Version Path
brycesch-devise_oauth2_providable-1.2.8 spec/models/refresh_token_spec.rb
brycesch-devise_oauth2_providable-1.2.7 spec/models/refresh_token_spec.rb
brycesch-devise_oauth2_providable-1.2.6 spec/models/refresh_token_spec.rb
brycesch-devise_oauth2_providable-1.2.5 spec/models/refresh_token_spec.rb
brycesch-devise_oauth2_providable-1.2.4 spec/models/refresh_token_spec.rb
brycesch-devise_oauth2_providable-1.2.3 spec/models/refresh_token_spec.rb
brycesch-devise_oauth2_providable-1.2.2 spec/models/refresh_token_spec.rb
brycesch-devise_oauth2_providable-1.2.1 spec/models/refresh_token_spec.rb
brycesch-devise_oauth2_providable-1.2.0 spec/models/refresh_token_spec.rb
brycesch-devise_oauth2_providable-1.1.7 spec/models/refresh_token_spec.rb