diff options
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/feed_manager_spec.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/spec/lib/feed_manager_spec.rb b/spec/lib/feed_manager_spec.rb index 3f91bba4e..a958a9afe 100644 --- a/spec/lib/feed_manager_spec.rb +++ b/spec/lib/feed_manager_spec.rb @@ -175,7 +175,7 @@ RSpec.describe FeedManager do it 'returns true for a status with a tag that matches a muted keyword' do Fabricate('Glitch::KeywordMute', account: alice, keyword: 'jorts') status = Fabricate(:status, account: bob) - status.tags << Fabricate(:tag, name: 'jorts') + status.tags << Fabricate(:tag, name: 'jorts') expect(FeedManager.instance.filter?(:home, status, alice.id)).to be true end @@ -183,7 +183,7 @@ RSpec.describe FeedManager do it 'returns true for a status with a tag that matches an octothorpe-prefixed muted keyword' do Fabricate('Glitch::KeywordMute', account: alice, keyword: '#jorts') status = Fabricate(:status, account: bob) - status.tags << Fabricate(:tag, name: 'jorts') + status.tags << Fabricate(:tag, name: 'jorts') expect(FeedManager.instance.filter?(:home, status, alice.id)).to be true end @@ -222,6 +222,13 @@ RSpec.describe FeedManager do bob.follow!(alice) expect(FeedManager.instance.filter?(:mentions, status, bob.id)).to be true end + + it 'returns false for a mention that contains a word muted by a keyword that does not apply to mentions' do + Fabricate('Glitch::KeywordMute', account: bob, keyword: 'take', apply_to_mentions: false) + status = Fabricate(:status, text: 'This is a hot take', account: alice) + bob.follow!(alice) + expect(FeedManager.instance.filter?(:mentions, status, bob.id)).to be false + end end end |