Sha256: 5d69a4e97de09cd1e358b694e86ff7434bbaed35903fe5e9a3195e368e07aac9

Contents?: true

Size: 696 Bytes

Versions: 5

Compression:

Stored size: 696 Bytes

Contents

require 'spec_helper'

describe Clearance::Configuration do
  describe 'when no user_model_name is specified' do
    before do
      Clearance.configure do |config|
      end
    end

    it 'defaults to User' do
      Clearance.configuration.user_model.should == ::User
    end
  end

  describe 'when a custom user_model_name is specified' do
    before do
      MyUser = Class.new

      Clearance.configure do |config|
        config.user_model = MyUser
      end
    end

    after do
      Clearance.configure do |config|
        config.user_model = ::User
      end
    end

    it 'is used instead of User' do
      Clearance.configuration.user_model.should == ::MyUser
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
clearance-1.0.0.rc6 spec/configuration_spec.rb
clearance-1.0.0.rc4 spec/configuration_spec.rb
clearance-1.0.0.rc3 spec/configuration_spec.rb
clearance-1.0.0.rc2 spec/configuration_spec.rb
clearance-1.0.0.rc1 spec/configuration_spec.rb