Browse Source

Add a FeedManager example demonstrating non-mention keywords. #454.

closed-social-glitch-2
David Yip 6 years ago
parent
commit
cf28049f0a
No known key found for this signature in database GPG Key ID: 7DA0036508FCC0CC
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      spec/lib/feed_manager_spec.rb

+ 7
- 0
spec/lib/feed_manager_spec.rb View File

@ -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

Loading…
Cancel
Save