2017-04-19 12:52:37 +01:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
describe FollowerAccountsController do
|
|
|
|
render_views
|
2017-04-28 14:12:37 +01:00
|
|
|
|
2017-04-19 12:52:37 +01:00
|
|
|
let(:alice) { Fabricate(:account, username: 'alice') }
|
2017-05-23 12:12:19 +01:00
|
|
|
let(:follower0) { Fabricate(:account) }
|
|
|
|
let(:follower1) { Fabricate(:account) }
|
2017-04-19 12:52:37 +01:00
|
|
|
|
|
|
|
describe 'GET #index' do
|
2017-05-23 12:12:19 +01:00
|
|
|
it 'assigns follows' do
|
|
|
|
follow0 = follower0.follow!(alice)
|
|
|
|
follow1 = follower1.follow!(alice)
|
|
|
|
|
2017-04-19 12:52:37 +01:00
|
|
|
get :index, params: { account_username: alice.username }
|
|
|
|
|
2017-05-23 12:12:19 +01: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 20:35:07 +01:00
|
|
|
expect(response).to have_http_status(200)
|
2017-04-19 12:52:37 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|