mirror of
https://github.com/internetee/registry.git
synced 2025-07-01 08:43:37 +02:00
Ignore empty identity for regisrar user switch #2754
This commit is contained in:
parent
85e5a17509
commit
598ab7ba63
4 changed files with 32 additions and 11 deletions
|
@ -3,6 +3,22 @@ require 'rails_helper'
|
|||
describe ApiUser do
|
||||
it { should belong_to(:registrar) }
|
||||
|
||||
context 'class methods' do
|
||||
before do
|
||||
Fabricate(:api_user, identity_code: '')
|
||||
Fabricate(:api_user, identity_code: 14212128025)
|
||||
end
|
||||
|
||||
it 'should return all api users with given identity code' do
|
||||
ApiUser.all_by_identity_code('14212128025').size.should == 1
|
||||
ApiUser.all_by_identity_code(14212128025).size.should == 1
|
||||
end
|
||||
|
||||
it 'should not return any api user with blank identity code' do
|
||||
ApiUser.all_by_identity_code('').size.should == 0
|
||||
end
|
||||
end
|
||||
|
||||
context 'with invalid attribute' do
|
||||
before :all do
|
||||
@api_user = ApiUser.new
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue