Sha256: c5dc626624b4712128afe3a7243eb7479527fe8da5dea04eb05546f8b50fcac1

Contents?: true

Size: 779 Bytes

Versions: 13

Compression:

Stored size: 779 Bytes

Contents

require 'spec_helper'

describe Devise::Oauth2::AuthorizationCode do
  describe 'basic authorization code instance' do
    with :client
    subject do
      Devise::Oauth2::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

13 entries across 13 versions & 1 rubygems

Version Path
devise_oauth2_rails4-2.1.4 spec/models/authorization_code_spec.rb
devise_oauth2_rails4-2.1.3 spec/models/authorization_code_spec.rb
devise_oauth2_rails4-2.0.3 spec/models/authorization_code_spec.rb
devise_oauth2_rails4-2.1.0 spec/models/authorization_code_spec.rb
devise_oauth2_rails4-2.0.2 spec/models/authorization_code_spec.rb
devise_oauth2_rails4-2.0.1 spec/models/authorization_code_spec.rb
devise_oauth2_rails4-2.0.0 spec/models/authorization_code_spec.rb
devise_oauth2_rails4-1.1.8 spec/models/authorization_code_spec.rb
devise_oauth2_rails4-1.1.7 spec/models/authorization_code_spec.rb
devise_oauth2_rails4-1.1.6 spec/models/authorization_code_spec.rb
devise_oauth2_rails4-1.1.5 spec/models/authorization_code_spec.rb
devise_oauth2_rails4-1.1.4 spec/models/authorization_code_spec.rb
devise_oauth2_rails4-1.1.3 spec/models/authorization_code_spec.rb