diff options
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/follower_accounts_controller_spec.rb | 12 | ||||
-rw-r--r-- | spec/controllers/following_accounts_controller_spec.rb | 12 |
2 files changed, 22 insertions, 2 deletions
diff --git a/spec/controllers/follower_accounts_controller_spec.rb b/spec/controllers/follower_accounts_controller_spec.rb index f2082f601..b9b7fef73 100644 --- a/spec/controllers/follower_accounts_controller_spec.rb +++ b/spec/controllers/follower_accounts_controller_spec.rb @@ -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 diff --git a/spec/controllers/following_accounts_controller_spec.rb b/spec/controllers/following_accounts_controller_spec.rb index f4a7e88f9..55e7265c7 100644 --- a/spec/controllers/following_accounts_controller_spec.rb +++ b/spec/controllers/following_accounts_controller_spec.rb @@ -4,11 +4,21 @@ describe FollowingAccountsController do render_views let(:alice) { Fabricate(:account, username: 'alice') } + let(:followee0) { Fabricate(:account) } + let(:followee1) { Fabricate(:account) } describe 'GET #index' do - it 'returns http success' do + it 'assigns followees' do + follow0 = alice.follow!(followee0) + follow1 = alice.follow!(followee1) + 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 |