lookup_spec.rb 713 B

123456789101112131415161718192021
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. RSpec.describe 'Accounts Lookup API' do
  4. let(:user) { Fabricate(:user) }
  5. let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: scopes) }
  6. let(:scopes) { 'read:accounts' }
  7. let(:headers) { { 'Authorization' => "Bearer #{token.token}" } }
  8. let(:account) { Fabricate(:account) }
  9. describe 'GET /api/v1/accounts/lookup' do
  10. it 'returns http success' do
  11. get '/api/v1/accounts/lookup', params: { account_id: account.id, acct: account.acct }, headers: headers
  12. expect(response).to have_http_status(200)
  13. expect(response.content_type)
  14. .to start_with('application/json')
  15. end
  16. end
  17. end