about summary refs log tree commit diff
path: root/spec/services
diff options
context:
space:
mode:
authorTomohiro Suwa <neoen.gsn@gmail.com>2017-04-18 02:57:02 +0900
committerEugen <eugen@zeonfederated.com>2017-04-17 19:57:02 +0200
commit3399dd7a666d755288cabf55fbb71b7276f6ffb7 (patch)
tree55955559db2ce001d2fd11e5b99de695b2e46a1d /spec/services
parent630de52fdd93e7465d0fb9dac5f35db30a2545d2 (diff)
Fix nil query_username (#2013)
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/account_search_service_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/services/account_search_service_spec.rb b/spec/services/account_search_service_spec.rb
index fa421c443..723623833 100644
--- a/spec/services/account_search_service_spec.rb
+++ b/spec/services/account_search_service_spec.rb
@@ -25,6 +25,18 @@ describe AccountSearchService do
     end
 
     describe 'searching local and remote users' do
+      describe "when only '@'" do
+        before do
+          allow(Account).to receive(:find_remote)
+          allow(Account).to receive(:search_for)
+          subject.call('@', 10)
+        end
+
+        it 'uses find_remote with empty query to look for local accounts' do
+          expect(Account).to have_received(:find_remote).with('', nil)
+        end
+      end
+
       describe 'when no domain' do
         before do
           allow(Account).to receive(:find_remote)