about summary refs log tree commit diff
path: root/spec
diff options
context:
space:
mode:
authorDavid Yip <yipdw@member.fsf.org>2017-10-24 18:51:27 -0500
committerDavid Yip <yipdw@member.fsf.org>2017-10-24 18:51:27 -0500
commitd03b48cea06ac87eecaf7eae96d175ab8ee621ca (patch)
treec74c22267765dad868ad11918b939cc3e0873dc9 /spec
parent9226257a1b43727d61f78621ff7eaadbe37c8fda (diff)
Also filter notifications containing muted keywords.
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/feed_manager_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/lib/feed_manager_spec.rb b/spec/lib/feed_manager_spec.rb
index 23ce373f2..e678d3ca4 100644
--- a/spec/lib/feed_manager_spec.rb
+++ b/spec/lib/feed_manager_spec.rb
@@ -185,6 +185,13 @@ RSpec.describe FeedManager do
         bob.follow!(alice)
         expect(FeedManager.instance.filter?(:mentions, status, bob.id)).to be false
       end
+
+      it 'returns true for status that contains a muted keyword' do
+        Fabricate('Glitch::KeywordMute', account: bob, keyword: 'take')
+        status = Fabricate(:status, text: 'This is a hot take', account: alice)
+        bob.follow!(alice)
+        expect(FeedManager.instance.filter?(:mentions, status, bob.id)).to be true
+      end
     end
   end