2017-04-19 13:52:37 +02:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
describe FollowerAccountsController 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(:follower0) { Fabricate(:account) }
|
|
|
|
let(:follower1) { Fabricate(:account) }
|
2017-04-19 13:52:37 +02:00
|
|
|
|
|
|
|
describe 'GET #index' do
|
2017-05-23 13:12:19 +02:00
|
|
|
it 'assigns follows' do
|
|
|
|
follow0 = follower0.follow!(alice)
|
|
|
|
follow1 = follower1.follow!(alice)
|
|
|
|
|
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
|
|
|
|
|
2018-04-21 21:35:07 +02:00
|
|
|
expect(response).to have_http_status(200)
|
2017-04-19 13:52:37 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|