mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-24 13:35:07 +01:00
Fixed the lookup API method
This commit is contained in:
parent
5b10329394
commit
c28971c70c
@ -1,4 +1,7 @@
|
|||||||
class Api::Accounts::LookupController < ApplicationController
|
class Api::Accounts::LookupController < ApiController
|
||||||
|
before_action :doorkeeper_authorize!
|
||||||
|
respond_to :json
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@accounts = Account.where(domain: nil).where(username: lookup_params)
|
@accounts = Account.where(domain: nil).where(username: lookup_params)
|
||||||
end
|
end
|
||||||
|
@ -10,9 +10,9 @@ RSpec.describe Api::Accounts::LookupController, type: :controller do
|
|||||||
|
|
||||||
describe 'GET #index' do
|
describe 'GET #index' do
|
||||||
before do
|
before do
|
||||||
Fabricate(:account, username: 'alice')
|
|
||||||
Fabricate(:account, username: 'bob')
|
Fabricate(:account, username: 'bob')
|
||||||
get :index, usernames: 'alice,bob'
|
Fabricate(:account, username: 'mcbeth')
|
||||||
|
get :index, usernames: 'alice,bob,mcbeth'
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
|
Loading…
Reference in New Issue
Block a user