0
0
Fork 0

Add ability to filter followed accounts' posts by language (#19095)

This commit is contained in:
Eugen Rochko 2022-09-20 23:51:21 +02:00 committed by GitHub
parent 882e54c786
commit 50948b46aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 298 additions and 39 deletions

View file

@ -127,6 +127,18 @@ RSpec.describe FeedManager do
reblog = Fabricate(:status, reblog: status, account: jeff)
expect(FeedManager.instance.filter?(:home, reblog, alice)).to be true
end
it 'returns true for German post when follow is set to English only' do
alice.follow!(bob, languages: %w(en))
status = Fabricate(:status, text: 'Hallo Welt', account: bob, language: 'de')
expect(FeedManager.instance.filter?(:home, status, alice)).to be true
end
it 'returns false for German post when follow is set to German' do
alice.follow!(bob, languages: %w(de))
status = Fabricate(:status, text: 'Hallo Welt', account: bob, language: 'de')
expect(FeedManager.instance.filter?(:home, status, alice)).to be false
end
end
context 'for mentions feed' do