Admin user model returns min password length

This commit is contained in:
Artur Beljajev 2016-12-08 19:04:25 +02:00
parent b08e881a24
commit 14457921cc
2 changed files with 10 additions and 0 deletions

View file

@ -11,6 +11,10 @@ class AdminUser < User
devise :database_authenticatable, :rememberable, :trackable, :validatable, :lockable
def self.min_password_length
Devise.password_length.min
end
def to_s
username
end

View file

@ -33,4 +33,10 @@ RSpec.describe AdminUser do
@admin_user.errors.full_messages.should match_array(["Password confirmation doesn't match Password"])
end
end
describe '::min_password_length' do
it 'returns minimum password length' do
expect(described_class.min_password_length).to eq(8)
end
end
end