about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/api/accounts/lookup_controller.rb5
-rw-r--r--spec/controllers/api/accounts/lookup_controller_spec.rb4
2 files changed, 6 insertions, 3 deletions
diff --git a/app/controllers/api/accounts/lookup_controller.rb b/app/controllers/api/accounts/lookup_controller.rb
index dc8bcb132..319401a2e 100644
--- a/app/controllers/api/accounts/lookup_controller.rb
+++ b/app/controllers/api/accounts/lookup_controller.rb
@@ -1,4 +1,7 @@
-class Api::Accounts::LookupController < ApplicationController
+class Api::Accounts::LookupController < ApiController
+  before_action :doorkeeper_authorize!
+  respond_to    :json
+
   def index
     @accounts = Account.where(domain: nil).where(username: lookup_params)
   end
diff --git a/spec/controllers/api/accounts/lookup_controller_spec.rb b/spec/controllers/api/accounts/lookup_controller_spec.rb
index 30dee8a3d..46c904b5a 100644
--- a/spec/controllers/api/accounts/lookup_controller_spec.rb
+++ b/spec/controllers/api/accounts/lookup_controller_spec.rb
@@ -10,9 +10,9 @@ RSpec.describe Api::Accounts::LookupController, type: :controller do
 
   describe 'GET #index' do
     before do
-      Fabricate(:account, username: 'alice')
       Fabricate(:account, username: 'bob')
-      get :index, usernames: 'alice,bob'
+      Fabricate(:account, username: 'mcbeth')
+      get :index, usernames: 'alice,bob,mcbeth'
     end
 
     it 'returns http success' do