Introduce recent to Follow (#3247)
Introduce recent to Follow, as Account and other models have. This change also adds specs for the scope and the dependents.
This commit is contained in:
parent
860ffc0560
commit
bf575a1f5e
6 changed files with 41 additions and 6 deletions
|
@ -4,11 +4,21 @@ describe FollowerAccountsController do
|
|||
render_views
|
||||
|
||||
let(:alice) { Fabricate(:account, username: 'alice') }
|
||||
let(:follower0) { Fabricate(:account) }
|
||||
let(:follower1) { Fabricate(:account) }
|
||||
|
||||
describe 'GET #index' do
|
||||
it 'returns http success' do
|
||||
it 'assigns follows' do
|
||||
follow0 = follower0.follow!(alice)
|
||||
follow1 = follower1.follow!(alice)
|
||||
|
||||
get :index, params: { account_username: alice.username }
|
||||
|
||||
assigned = assigns(:follows).to_a
|
||||
expect(assigned.size).to eq 2
|
||||
expect(assigned[0]).to eq follow1
|
||||
expect(assigned[1]).to eq follow0
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue