diff options
author | beatrix <beatrix.bitrot@gmail.com> | 2017-11-18 12:06:40 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-18 12:06:40 -0500 |
commit | dec960c828390466c8fa802ac30e68041a64bff6 (patch) | |
tree | df40a7b4592c0d35f65e2b9062685daad4d3ffd5 /spec/lib | |
parent | eed50514bea3c5a1aa96b0193b26331014bf9e9b (diff) | |
parent | c2a92dffc920cda6985dce0a0f77ae25b85659aa (diff) |
Merge pull request #208 from yipdw/keyword-mute
Run keyword mutes on hashtags
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/feed_manager_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/lib/feed_manager_spec.rb b/spec/lib/feed_manager_spec.rb index ba96b6e7e..f87ef383a 100644 --- a/spec/lib/feed_manager_spec.rb +++ b/spec/lib/feed_manager_spec.rb @@ -164,6 +164,22 @@ RSpec.describe FeedManager do expect(FeedManager.instance.filter?(:home, reblog, alice.id)).to be true end + + 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') + + expect(FeedManager.instance.filter?(:home, status, alice.id)).to be true + end + + 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') + + expect(FeedManager.instance.filter?(:home, status, alice.id)).to be true + end end context 'for mentions feed' do |