about summary refs log tree commit diff
path: root/spec/lib/feed_manager_spec.rb
diff options
context:
space:
mode:
authorDavid Yip <yipdw@member.fsf.org>2017-10-21 15:44:47 -0500
committerDavid Yip <yipdw@member.fsf.org>2017-10-21 15:44:47 -0500
commitad86c86fa8e0d577b1a6c7411367420e6beea4ea (patch)
treee0be0cb0ca1e454b8e3cd73d6471163018e6efc0 /spec/lib/feed_manager_spec.rb
parent670e6a33f8eeca628707dc020e02ce32502d74a4 (diff)
Apply keyword mutes to reblogs.
Diffstat (limited to 'spec/lib/feed_manager_spec.rb')
-rw-r--r--spec/lib/feed_manager_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/lib/feed_manager_spec.rb b/spec/lib/feed_manager_spec.rb
index 1861cc6ed..c9403d616 100644
--- a/spec/lib/feed_manager_spec.rb
+++ b/spec/lib/feed_manager_spec.rb
@@ -119,6 +119,23 @@ RSpec.describe FeedManager do
         reblog = Fabricate(:status, reblog: status, account: jeff)
         expect(FeedManager.instance.filter?(:home, reblog, alice.id)).to be true
       end
+
+      it 'returns true for a status containing a muted keyword' do
+        Fabricate('Glitch::KeywordMute', account: alice, keyword: 'take')
+        alice.follow!(bob)
+        status = Fabricate(:status, text: 'This is a hot take', account: bob)
+
+        expect(FeedManager.instance.filter?(:home, status, alice.id)).to be true
+      end
+
+      it 'returns true for a reblog containing a muted keyword' do
+        Fabricate('Glitch::KeywordMute', account: alice, keyword: 'take')
+        alice.follow!(jeff)
+        status = Fabricate(:status, text: 'This is a hot take', account: bob)
+        reblog = Fabricate(:status, reblog: status, account: jeff)
+
+        expect(FeedManager.instance.filter?(:home, reblog, alice.id)).to be true
+      end
     end
 
     context 'for mentions feed' do