Sha256: 5b21a6fb6c5f39d5c5375cc5fce28897cdb210691ad4615d7e0752bfe3e437f2
Contents?: true
Size: 1.46 KB
Versions: 1
Compression:
Stored size: 1.46 KB
Contents
require 'spec_helper' require 'authenticate/configuration' describe Authenticate::Configuration do context 'user model' do module Gug class Profile extend ActiveModel::Naming end end before(:each) do @conf = Authenticate::Configuration.new @conf.user_model = 'Gug::Profile' end it 'gets a class for a user model' do expect(@conf.user_model_class).to be(Gug::Profile) end it 'get a route key for a user model' do expect(@conf.user_model_route_key).to eq('gug_profiles') end it 'get a param key for a user model' do expect(@conf.user_model_param_key).to eq('gug_profile') end describe '#authentication_strategy' do context 'with no strategy set' do it 'defaults to email' do expect(@conf.authentication_strategy).to eq :email end it 'includes email in modules' do expect(@conf.modules).to include :email end it 'does not include username in modules' do expect(@conf.modules).to_not include :username end end context 'with strategy set to username' do before do @conf.authentication_strategy = :username end it 'includes username in modules' do expect(@conf.modules).to include :username end it 'does not include email in modules' do expect(@conf.modules).to_not include :email end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
authenticate-0.3.0 | spec/model/configuration_spec.rb |