Merge commit '1483a3ddfe74e4fb81d87447a1781943eab86c60' into glitch-soc/merge-upstream
Conflicts: - `config/initializers/simple_form.rb`: Upstream added a new simple_form component, where we had an extra one. Kept both components.
This commit is contained in:
@@ -26,6 +26,7 @@ RSpec.describe FeedManager do
|
||||
let(:alice) { Fabricate(:account, username: 'alice') }
|
||||
let(:bob) { Fabricate(:account, username: 'bob', domain: 'example.com') }
|
||||
let(:jeff) { Fabricate(:account, username: 'jeff') }
|
||||
let(:list) { Fabricate(:list, account: alice) }
|
||||
|
||||
context 'with home feed' do
|
||||
it 'returns false for followee\'s status' do
|
||||
@@ -160,6 +161,42 @@ RSpec.describe FeedManager do
|
||||
status = Fabricate(:status, text: 'Hallo Welt', account: bob, language: 'de')
|
||||
expect(FeedManager.instance.filter?(:home, status, alice)).to be false
|
||||
end
|
||||
|
||||
it 'returns true for post from followee on exclusive list' do
|
||||
list.exclusive = true
|
||||
alice.follow!(bob)
|
||||
list.accounts << bob
|
||||
allow(List).to receive(:where).and_return(list)
|
||||
status = Fabricate(:status, text: 'I post a lot', account: bob)
|
||||
expect(FeedManager.instance.filter?(:home, status, alice)).to be true
|
||||
end
|
||||
|
||||
it 'returns true for reblog from followee on exclusive list' do
|
||||
list.exclusive = true
|
||||
alice.follow!(jeff)
|
||||
list.accounts << jeff
|
||||
allow(List).to receive(:where).and_return(list)
|
||||
status = Fabricate(:status, text: 'I post a lot', account: bob)
|
||||
reblog = Fabricate(:status, reblog: status, account: jeff)
|
||||
expect(FeedManager.instance.filter?(:home, reblog, alice)).to be true
|
||||
end
|
||||
|
||||
it 'returns false for post from followee on non-exclusive list' do
|
||||
list.exclusive = false
|
||||
alice.follow!(bob)
|
||||
list.accounts << bob
|
||||
status = Fabricate(:status, text: 'I post a lot', account: bob)
|
||||
expect(FeedManager.instance.filter?(:home, status, alice)).to be false
|
||||
end
|
||||
|
||||
it 'returns false for reblog from followee on non-exclusive list' do
|
||||
list.exclusive = false
|
||||
alice.follow!(jeff)
|
||||
list.accounts << jeff
|
||||
status = Fabricate(:status, text: 'I post a lot', account: bob)
|
||||
reblog = Fabricate(:status, reblog: status, account: jeff)
|
||||
expect(FeedManager.instance.filter?(:home, reblog, alice)).to be false
|
||||
end
|
||||
end
|
||||
|
||||
context 'with mentions feed' do
|
||||
|
||||
Reference in New Issue
Block a user