0
0
Fork 0

Remove unused methods (#1730)

* Remove unused method #set_counters_maps from api controller

* Remove unused method #set_account_counters_maps from api controller

* Remove unused method Account#followers_domains

* Remove unused User.prolific scope

* Add mastodon:users:admins task to list all admin emails

* Use interpolated query style in Account.triadic_closures

* Coverage for Account.triadic_closures
This commit is contained in:
Matt Jankowski 2017-04-17 19:21:55 -04:00 committed by Eugen
parent 0e0347ea3c
commit 16d50f60d1
5 changed files with 29 additions and 22 deletions

View file

@ -245,6 +245,23 @@ RSpec.describe Account, type: :model do
end
end
describe '.triadic_closures' do
it 'finds accounts you dont follow which are followed by accounts you do follow' do
me = Fabricate(:account)
friend = Fabricate(:account)
friends_friend = Fabricate(:account)
me.follow!(friend)
friend.follow!(friends_friend)
both_follow = Fabricate(:account)
me.follow!(both_follow)
friend.follow!(both_follow)
results = Account.triadic_closures(me)
expect(results).to eq [friends_friend]
end
end
describe '.find_local' do
before do
Fabricate(:account, username: 'Alice')