1
0

following_accounts_controller_spec.rb 654 B

12345678910111213141516171819202122232425
  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