2017-04-19 13:52:37 +02:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
describe FollowingAccountsController do
|
|
|
|
render_views
|
2017-04-28 15:12:37 +02:00
|
|
|
|
2017-04-19 13:52:37 +02:00
|
|
|
let(:alice) { Fabricate(:account, username: 'alice') }
|
2017-05-23 13:12:19 +02:00
|
|
|
let(:followee0) { Fabricate(:account) }
|
|
|
|
let(:followee1) { Fabricate(:account) }
|
2017-04-19 13:52:37 +02:00
|
|
|
|
|
|
|
describe 'GET #index' do
|
2017-05-23 13:12:19 +02:00
|
|
|
it 'assigns followees' do
|
|
|
|
follow0 = alice.follow!(followee0)
|
|
|
|
follow1 = alice.follow!(followee1)
|
|
|
|
|
2017-04-19 13:52:37 +02:00
|
|
|
get :index, params: { account_username: alice.username }
|
|
|
|
|
2017-05-23 13:12:19 +02:00
|
|
|
assigned = assigns(:follows).to_a
|
|
|
|
expect(assigned.size).to eq 2
|
|
|
|
expect(assigned[0]).to eq follow1
|
|
|
|
expect(assigned[1]).to eq follow0
|
|
|
|
|
2017-04-19 13:52:37 +02:00
|
|
|
expect(response).to have_http_status(:success)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|