Handle nil and blank cases in Account finders (#3500)
This commit is contained in:
		
					parent
					
						
							
								dbccdcc1b1
							
						
					
				
			
			
				commit
				
					
						d1e08bd38c
					
				
			
		
					 2 changed files with 23 additions and 3 deletions
				
			
		|  | @ -24,6 +24,14 @@ describe AccountFinderConcern do | |||
|       it 'returns nil for regex style username value' do | ||||
|         expect(Account.find_local('al%')).to be_nil | ||||
|       end | ||||
| 
 | ||||
|       it 'returns nil for nil username value' do | ||||
|         expect(Account.find_local(nil)).to be_nil | ||||
|       end | ||||
| 
 | ||||
|       it 'returns nil for blank username value' do | ||||
|         expect(Account.find_local('')).to be_nil | ||||
|       end | ||||
|     end | ||||
| 
 | ||||
|     describe '.find_local!' do | ||||
|  | @ -70,6 +78,14 @@ describe AccountFinderConcern do | |||
|       it 'returns nil for regex style domain value' do | ||||
|         expect(Account.find_remote('alice', 'm%')).to be_nil | ||||
|       end | ||||
| 
 | ||||
|       it 'returns nil for nil username value' do | ||||
|         expect(Account.find_remote(nil, 'domain')).to be_nil | ||||
|       end | ||||
| 
 | ||||
|       it 'returns nil for blank username value' do | ||||
|         expect(Account.find_remote('', 'domain')).to be_nil | ||||
|       end | ||||
|     end | ||||
| 
 | ||||
|     describe '.find_remote!' do | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue