You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
633 B

  1. require 'rails_helper'
  2. RSpec.describe Api::Accounts::LookupController, type: :controller do
  3. let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) }
  4. let(:token) { double acceptable?: true, resource_owner_id: user.id }
  5. before do
  6. allow(controller).to receive(:doorkeeper_token) { token }
  7. end
  8. describe 'GET #index' do
  9. before do
  10. Fabricate(:account, username: 'bob')
  11. Fabricate(:account, username: 'mcbeth')
  12. get :index, params: { usernames: 'alice,bob,mcbeth' }
  13. end
  14. it 'returns http success' do
  15. expect(response).to have_http_status(:success)
  16. end
  17. end
  18. end