about summary refs log tree commit diff
path: root/spec/lib
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-07-07 21:40:49 +0200
committerThibaut Girka <thib@sitedethib.com>2018-07-09 19:19:23 +0200
commit402da8065c2b378cca6361f2c7252bd766f25dde (patch)
treeeda07c40c934ab9a55d7847afe4af3e54bce86b8 /spec/lib
parentee41947e9defce24ecd9f46329bb953d46b335bd (diff)
Migrate glitch-soc keyword mutes to Mastodon's
Completely remove glitch-soc's Keyword Mutes, migrate
existing database records to CustomFilters.

Handling of client-side filters is still not implemented
in the glitch-soc front-end.
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/feed_manager_spec.rb76
1 files changed, 0 insertions, 76 deletions
diff --git a/spec/lib/feed_manager_spec.rb b/spec/lib/feed_manager_spec.rb
index 8305530c5..a36ebad49 100644
--- a/spec/lib/feed_manager_spec.rb
+++ b/spec/lib/feed_manager_spec.rb
@@ -134,68 +134,6 @@ RSpec.describe FeedManager do
         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')
-        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 reply containing a muted keyword' do
-        Fabricate('Glitch::KeywordMute', account: alice, keyword: 'take')
-        s1 = Fabricate(:status, text: 'Something', account: alice)
-        s2 = Fabricate(:status, text: 'This is a hot take', thread: s1, account: bob)
-
-        expect(FeedManager.instance.filter?(:home, s2, alice.id)).to be true
-      end
-
-      it 'returns true for a status whose spoiler text contains a muted keyword' do
-        Fabricate('Glitch::KeywordMute', account: alice, keyword: 'take')
-        status = Fabricate(:status, spoiler_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')
-        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
-
-      it 'returns true for a reblog whose spoiler text contains a muted keyword' do
-        Fabricate('Glitch::KeywordMute', account: alice, keyword: 'take')
-        status = Fabricate(:status, spoiler_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
-
-      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
-
-      it 'returns false if the status is muted by a keyword mute that does not apply to mentions' do
-        Fabricate('Glitch::KeywordMute', account: alice, keyword: 'take', apply_to_mentions: false)
-        status = Fabricate(:status, spoiler_text: 'This is a hot take', account: bob)
-        status.mentions.create!(account_id: alice.id)
-
-        expect(FeedManager.instance.filter?(:home, status, alice.id)).to be false
-      end
-
       context 'for irreversibly muted phrases' do
         it 'considers word boundaries when matching' do
           alice.custom_filters.create!(phrase: 'bob', context: %w(home), irreversible: true)
@@ -247,20 +185,6 @@ 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
-
-      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