about summary refs log tree commit diff
path: root/spec/models
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/concerns/account_finder_concern_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/models/concerns/account_finder_concern_spec.rb b/spec/models/concerns/account_finder_concern_spec.rb
index 05f0f44f2..25f4fdec4 100644
--- a/spec/models/concerns/account_finder_concern_spec.rb
+++ b/spec/models/concerns/account_finder_concern_spec.rb
@@ -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