Added stack trace for SQL queries in development Removed badly thought out accounts/lookup APImain
parent
a4cc966476
commit
85d89b472d
@ -1,14 +0,0 @@
|
|||||||
class Api::Accounts::LookupController < ApiController
|
|
||||||
before_action :doorkeeper_authorize!
|
|
||||||
respond_to :json
|
|
||||||
|
|
||||||
def index
|
|
||||||
@accounts = Account.where(domain: nil).where(username: lookup_params)
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def lookup_params
|
|
||||||
(params[:usernames] || '').split(',').map(&:strip)
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,2 +0,0 @@
|
|||||||
module Api::Accounts::LookupHelper
|
|
||||||
end
|
|
@ -1,24 +0,0 @@
|
|||||||
require 'rails_helper'
|
|
||||||
|
|
||||||
RSpec.describe Api::Accounts::LookupController, type: :controller do
|
|
||||||
render_views
|
|
||||||
|
|
||||||
let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) }
|
|
||||||
let(:token) { double acceptable?: true, resource_owner_id: user.id }
|
|
||||||
|
|
||||||
before do
|
|
||||||
allow(controller).to receive(:doorkeeper_token) { token }
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'GET #index' do
|
|
||||||
before do
|
|
||||||
Fabricate(:account, username: 'bob')
|
|
||||||
Fabricate(:account, username: 'mcbeth')
|
|
||||||
get :index, params: { usernames: 'alice,bob,mcbeth' }
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'returns http success' do
|
|
||||||
expect(response).to have_http_status(:success)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,5 +0,0 @@
|
|||||||
require 'rails_helper'
|
|
||||||
|
|
||||||
RSpec.describe Api::Accounts::LookupHelper, type: :helper do
|
|
||||||
|
|
||||||
end
|
|
Loading…
Reference in new issue