Lists (#5703)
* Add structure for lists * Add list timeline streaming API * Add list APIs, bind list-account relation to follow relation * Add API for adding/removing accounts from lists * Add pagination to lists API * Add pagination to list accounts API * Adjust scopes for new APIs - Creating and modifying lists merely requires "write" scope - Fetching information about lists merely requires "read" scope * Add test for wrong user context on list timeline * Clean up tests
This commit is contained in:
parent
4a2fc2d444
commit
24cafd73a2
67 changed files with 855 additions and 224 deletions
|
@ -11,41 +11,41 @@ describe FeedInsertWorker do
|
|||
|
||||
context 'when there are no records' do
|
||||
it 'skips push with missing status' do
|
||||
instance = double(push: nil)
|
||||
instance = double(push_to_home: nil)
|
||||
allow(FeedManager).to receive(:instance).and_return(instance)
|
||||
result = subject.perform(nil, follower.id)
|
||||
|
||||
expect(result).to eq true
|
||||
expect(instance).not_to have_received(:push)
|
||||
expect(instance).not_to have_received(:push_to_home)
|
||||
end
|
||||
|
||||
it 'skips push with missing account' do
|
||||
instance = double(push: nil)
|
||||
instance = double(push_to_home: nil)
|
||||
allow(FeedManager).to receive(:instance).and_return(instance)
|
||||
result = subject.perform(status.id, nil)
|
||||
|
||||
expect(result).to eq true
|
||||
expect(instance).not_to have_received(:push)
|
||||
expect(instance).not_to have_received(:push_to_home)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when there are real records' do
|
||||
it 'skips the push when there is a filter' do
|
||||
instance = double(push: nil, filter?: true)
|
||||
instance = double(push_to_home: nil, filter?: true)
|
||||
allow(FeedManager).to receive(:instance).and_return(instance)
|
||||
result = subject.perform(status.id, follower.id)
|
||||
|
||||
expect(result).to be_nil
|
||||
expect(instance).not_to have_received(:push)
|
||||
expect(instance).not_to have_received(:push_to_home)
|
||||
end
|
||||
|
||||
it 'pushes the status onto the home timeline without filter' do
|
||||
instance = double(push: nil, filter?: false)
|
||||
instance = double(push_to_home: nil, filter?: false)
|
||||
allow(FeedManager).to receive(:instance).and_return(instance)
|
||||
result = subject.perform(status.id, follower.id)
|
||||
|
||||
expect(result).to be_nil
|
||||
expect(instance).to have_received(:push).with(:home, follower, status)
|
||||
expect(instance).to have_received(:push_to_home).with(follower, status)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue