Add ability to filter followed accounts' posts by language (#19095)
This commit is contained in:
parent
882e54c786
commit
50948b46aa
30 changed files with 298 additions and 39 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue