Skip to content
Snippets Groups Projects
Commit c28971c7 authored by Eugen Rochko's avatar Eugen Rochko
Browse files

Fixed the lookup API method

parent 5b103293
No related branches found
No related tags found
No related merge requests found
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
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment