aboutsummaryrefslogtreecommitdiff
path: root/spec/lib/feed_manager_spec.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2022-09-20 23:51:21 +0200
committerGitHub <noreply@github.com>2022-09-20 23:51:21 +0200
commit50948b46aabc0756d85bc6641f0bd3bcc09bf7d4 (patch)
tree19dd9e761aec2a33d6bc3c11b47673da40cd965b /spec/lib/feed_manager_spec.rb
parent882e54c78678bd4247d70fe5b04571543769bcee (diff)
downloadmastodon-50948b46aabc0756d85bc6641f0bd3bcc09bf7d4.tar
mastodon-50948b46aabc0756d85bc6641f0bd3bcc09bf7d4.tar.gz
mastodon-50948b46aabc0756d85bc6641f0bd3bcc09bf7d4.tar.bz2
mastodon-50948b46aabc0756d85bc6641f0bd3bcc09bf7d4.zip
Add ability to filter followed accounts' posts by language (#19095)
Diffstat (limited to 'spec/lib/feed_manager_spec.rb')
-rw-r--r--spec/lib/feed_manager_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/lib/feed_manager_spec.rb b/spec/lib/feed_manager_spec.rb
index 48c57b86e..0f3b05e5a 100644
--- a/spec/lib/feed_manager_spec.rb
+++ b/spec/lib/feed_manager_spec.rb
@@ -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