Sha256: 8b0f2734761ebb5a1c5f21c6f86e9ba38a33817d1b08fb020fa892e57354d15b

Contents?: true

Size: 944 Bytes

Versions: 11

Compression:

Stored size: 944 Bytes

Contents

require 'spec_helper'
require 'fixtures/models'

class BaseUser
  def initialize
  end
end

describe CanTango::Configuration::User do
  before do
    CanTango.config.user.base_class = User
    CanTango.config.user_account.base_class = UserAccount
  end

  subject { CanTango.config.user }

  describe 'default settings' do
    its(:relations)         { should_not be_empty }
    its(:unique_key_field)  { should == :email }
    its(:base_class)        { should == ::User }
  end

  describe 'set base class' do
    before do
      subject.base_class = BaseUser
    end

    its(:base_class)        { should == BaseUser }
  end

  describe 'relations config' do
    before do
      subject.relations = :mine
    end
    its(:relations)         { should include(:mine) }
  end

  describe 'unique_key_field config' do
    before do
      subject.unique_key_field = :username
    end
    its(:unique_key_field)  { should == :username }
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
cantango-config-0.1.9.2 spec/cantango/configuration/user_spec.rb
cantango-config-0.1.8.1 spec/cantango/configuration/user_spec.rb
cantango-config-0.1.8 spec/cantango/configuration/user_spec.rb
cantango-config-0.1.7 spec/cantango/configuration/user_spec.rb
cantango-config-0.1.6 spec/cantango/configuration/user_spec.rb
cantango-config-0.1.5 spec/cantango/configuration/user_spec.rb
cantango-config-0.1.4 spec/cantango/configuration/user_spec.rb
cantango-config-0.1.3 spec/cantango/configuration/user_spec.rb
cantango-config-0.1.2 spec/cantango/configuration/user_spec.rb
cantango-config-0.1.1 spec/cantango/configuration/user_spec.rb
cantango-config-0.1.0 spec/cantango/configuration/user_spec.rb