logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

lists_controller_spec.rb (702B)


  1. require 'rails_helper'
  2. describe Api::V1::Accounts::ListsController 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') }
  6. let(:account) { Fabricate(:account) }
  7. let(:list) { Fabricate(:list, account: user.account) }
  8. before do
  9. allow(controller).to receive(:doorkeeper_token) { token }
  10. user.account.follow!(account)
  11. list.accounts << account
  12. end
  13. describe 'GET #index' do
  14. it 'returns http success' do
  15. get :index, params: { account_id: account.id }
  16. expect(response).to have_http_status(:success)
  17. end
  18. end
  19. end