闭社主体 forked from https://github.com/tootsuite/mastodon
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.

25 lines
654 B

  1. require 'rails_helper'
  2. describe FollowingAccountsController do
  3. render_views
  4. let(:alice) { Fabricate(:account, username: 'alice') }
  5. let(:followee0) { Fabricate(:account) }
  6. let(:followee1) { Fabricate(:account) }
  7. describe 'GET #index' do
  8. it 'assigns followees' do
  9. follow0 = alice.follow!(followee0)
  10. follow1 = alice.follow!(followee1)
  11. get :index, params: { account_username: alice.username }
  12. assigned = assigns(:follows).to_a
  13. expect(assigned.size).to eq 2
  14. expect(assigned[0]).to eq follow1
  15. expect(assigned[1]).to eq follow0
  16. expect(response).to have_http_status(:success)
  17. end
  18. end
  19. end