Sha256: 66ca438f61aa350015465de0a33e22c23b70fc0f2881fb5f553a7d4d97d54a7d

Contents?: true

Size: 949 Bytes

Versions: 3

Compression:

Stored size: 949 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
    subject do
      client = Devise::Oauth2Providable::Client.create! :name => 'test', :redirect_uri => 'http://localhost:3000', :website => 'http://localhost'
      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

3 entries across 3 versions & 1 rubygems

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