Fix exclusive lists interfering with notifications (#28162)
This commit is contained in:
parent
5c06fe4902
commit
360b6d3a44
4 changed files with 51 additions and 40 deletions
|
@ -164,6 +164,7 @@ RSpec.describe FeedManager do
|
|||
allow(List).to receive(:where).and_return(list)
|
||||
status = Fabricate(:status, text: 'I post a lot', account: bob)
|
||||
expect(subject.filter?(:home, status, alice)).to be true
|
||||
expect(subject.filter(:home, status, alice)).to be :skip_home
|
||||
end
|
||||
|
||||
it 'returns true for reblog from followee on exclusive list' do
|
||||
|
@ -174,6 +175,7 @@ RSpec.describe FeedManager do
|
|||
status = Fabricate(:status, text: 'I post a lot', account: bob)
|
||||
reblog = Fabricate(:status, reblog: status, account: jeff)
|
||||
expect(subject.filter?(:home, reblog, alice)).to be true
|
||||
expect(subject.filter(:home, reblog, alice)).to be :skip_home
|
||||
end
|
||||
|
||||
it 'returns false for post from followee on non-exclusive list' do
|
||||
|
|
|
@ -32,7 +32,7 @@ RSpec.describe FeedInsertWorker do
|
|||
|
||||
context 'when there are real records' do
|
||||
it 'skips the push when there is a filter' do
|
||||
instance = instance_double(FeedManager, push_to_home: nil, filter?: true)
|
||||
instance = instance_double(FeedManager, push_to_home: nil, filter?: true, filter: :filter)
|
||||
allow(FeedManager).to receive(:instance).and_return(instance)
|
||||
result = subject.perform(status.id, follower.id)
|
||||
|
||||
|
@ -41,7 +41,7 @@ RSpec.describe FeedInsertWorker do
|
|||
end
|
||||
|
||||
it 'pushes the status onto the home timeline without filter' do
|
||||
instance = instance_double(FeedManager, push_to_home: nil, filter?: false)
|
||||
instance = instance_double(FeedManager, push_to_home: nil, filter?: false, filter: nil)
|
||||
allow(FeedManager).to receive(:instance).and_return(instance)
|
||||
result = subject.perform(status.id, follower.id, :home)
|
||||
|
||||
|
@ -50,7 +50,7 @@ RSpec.describe FeedInsertWorker do
|
|||
end
|
||||
|
||||
it 'pushes the status onto the tags timeline without filter' do
|
||||
instance = instance_double(FeedManager, push_to_home: nil, filter?: false)
|
||||
instance = instance_double(FeedManager, push_to_home: nil, filter?: false, filter: nil)
|
||||
allow(FeedManager).to receive(:instance).and_return(instance)
|
||||
result = subject.perform(status.id, follower.id, :tags)
|
||||
|
||||
|
@ -59,7 +59,7 @@ RSpec.describe FeedInsertWorker do
|
|||
end
|
||||
|
||||
it 'pushes the status onto the list timeline without filter' do
|
||||
instance = instance_double(FeedManager, push_to_list: nil, filter?: false)
|
||||
instance = instance_double(FeedManager, push_to_list: nil, filter?: false, filter: nil)
|
||||
allow(FeedManager).to receive(:instance).and_return(instance)
|
||||
result = subject.perform(status.id, list.id, :list)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue