Sha256: cdf662dd1372ed9e38766b2d51f30d27fffcbbf131652e3e963efe7ae02b92c7

Contents?: true

Size: 1013 Bytes

Versions: 4

Compression:

Stored size: 1013 Bytes

Contents

require 'spec_helper'

describe Devise::Oauth2Providable::Client do
  it { Devise::Oauth2Providable::Client.table_name.should == 'oauth2_clients' }

  describe 'basic client instance' do
    subject { Devise::Oauth2Providable::Client.create! :name => 'test', :redirect_uri => 'http://localhost:3000', :website => 'http://localhost' }
    it { should validate_presence_of :name }
    it { should validate_uniqueness_of :name }
    it { should allow_mass_assignment_of :name }
    it { should validate_presence_of :website }
    it { should allow_mass_assignment_of :website }
    it { should validate_presence_of :redirect_uri }
    it { should allow_mass_assignment_of :redirect_uri }
    it { should validate_uniqueness_of :identifier }
    it { should have_db_index(:identifier).unique(true) }
    it { should_not allow_mass_assignment_of :identifier }
    it { should_not allow_mass_assignment_of :secret }
    it { should have_many :refresh_tokens }
    it { should have_many :authorization_codes }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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