diff options
author | Jeong Arm <kjwonmail@gmail.com> | 2023-01-05 21:30:38 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-05 13:30:38 +0100 |
commit | fdd1facba16db75e425c02807323eb2666688652 (patch) | |
tree | d2e533e3f06de88968bdf0deaf92a09cf32596d5 /spec/lib | |
parent | 8eb29741b440e3eeac297ec89a49a3fb1c9deb8d (diff) |
Fix home TL could contain post from who blocked me (#22849)
* Fix home tl contains post from who blocked me * Add test * Fix feed_manager's build_crutches blocked_by was not includes status' owner * Add test for status from I blocked * Fix typo
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/feed_manager_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/lib/feed_manager_spec.rb b/spec/lib/feed_manager_spec.rb index 0f3b05e5a..eb55c3983 100644 --- a/spec/lib/feed_manager_spec.rb +++ b/spec/lib/feed_manager_spec.rb @@ -39,6 +39,18 @@ RSpec.describe FeedManager do expect(FeedManager.instance.filter?(:home, reblog, bob)).to be false end + it 'returns true for post from account who blocked me' do + status = Fabricate(:status, text: 'Hello, World', account: alice) + alice.block!(bob) + expect(FeedManager.instance.filter?(:home, status, bob)).to be true + end + + it 'returns true for post from blocked account' do + status = Fabricate(:status, text: 'Hello, World', account: alice) + bob.block!(alice) + expect(FeedManager.instance.filter?(:home, status, bob)).to be true + end + it 'returns true for reblog by followee of blocked account' do status = Fabricate(:status, text: 'Hello world', account: jeff) reblog = Fabricate(:status, reblog: status, account: alice) |