Skip to content
Extraits de code Groupes Projets
Valider 3399dd7a rédigé par Tomohiro Suwa's avatar Tomohiro Suwa Validation de Eugen
Parcourir les fichiers

Fix nil query_username (#2013)

parent 630de52f
Branches
Étiquettes
Aucune requête de fusion associée trouvée
...@@ -41,7 +41,7 @@ class AccountSearchService < BaseService ...@@ -41,7 +41,7 @@ class AccountSearchService < BaseService
end end
def query_username def query_username
@_query_username ||= split_query_string.first @_query_username ||= split_query_string.first || ''
end end
def query_domain def query_domain
......
...@@ -25,6 +25,18 @@ describe AccountSearchService do ...@@ -25,6 +25,18 @@ describe AccountSearchService do
end end
describe 'searching local and remote users' do 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 describe 'when no domain' do
before do before do
allow(Account).to receive(:find_remote) allow(Account).to receive(:find_remote)
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter