Introduce ApiUser.min_password_length

#248
This commit is contained in:
Artur Beljajev 2017-01-08 21:28:21 +02:00
parent 1784980e6c
commit fd58024226
2 changed files with 13 additions and 3 deletions

View file

@ -1,6 +1,6 @@
require 'rails_helper'
describe ApiUser do
RSpec.describe ApiUser do
context 'class methods' do
before do
Fabricate(:api_user, identity_code: '')
@ -26,7 +26,7 @@ describe ApiUser do
@api_user.valid?
@api_user.errors.full_messages.should match_array([
"Password Password is missing",
"Password is too short (minimum is 6 characters)",
"Password is too short (minimum is #{ApiUser.min_password_length} characters)",
"Registrar Registrar is missing",
"Username Username is missing",
"Roles is missing"
@ -68,4 +68,10 @@ describe ApiUser do
end
end
end
describe '::min_password_length', db: false do
it 'returns minimum password length' do
expect(described_class.min_password_length).to eq(6)
end
end
end