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