follower_accounts_controller_spec.rb 619 B

123456789101112131415161718192021
  1. require 'rails_helper'
  2. describe Api::V1::Accounts::FollowerAccountsController do
  3. render_views
  4. let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) }
  5. let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'read:accounts') }
  6. before do
  7. Fabricate(:follow, target_account: user.account)
  8. allow(controller).to receive(:doorkeeper_token) { token }
  9. end
  10. describe 'GET #index' do
  11. it 'returns http success' do
  12. get :index, params: { account_id: user.account.id, limit: 1 }
  13. expect(response).to have_http_status(200)
  14. end
  15. end
  16. end