parent
c6bcbb837f
commit
ae6fe58501
2 changed files with 42 additions and 5 deletions
|
@ -17,6 +17,7 @@ RSpec.describe FanOutOnWriteService, type: :service do
|
|||
let!(:bob) { Fabricate(:user, current_sign_in_at: last_active_at, account_attributes: { username: 'bob' }).account }
|
||||
let!(:tom) { Fabricate(:user, current_sign_in_at: last_active_at).account }
|
||||
let!(:ohagi) { Fabricate(:user, current_sign_in_at: last_active_at).account }
|
||||
let!(:tagf) { Fabricate(:user, current_sign_in_at: last_active_at).account }
|
||||
|
||||
let!(:list) { nil }
|
||||
let!(:empty_list) { nil }
|
||||
|
@ -37,6 +38,9 @@ RSpec.describe FanOutOnWriteService, type: :service do
|
|||
|
||||
allow(redis).to receive(:publish)
|
||||
|
||||
tag = status.tags.first
|
||||
Fabricate(:tag_follow, account: tagf, tag: tag) if tag.present?
|
||||
|
||||
subject.call(status) unless custom_before
|
||||
end
|
||||
|
||||
|
@ -87,6 +91,10 @@ RSpec.describe FanOutOnWriteService, type: :service do
|
|||
expect(home_feed_of(tom)).to include status.id
|
||||
end
|
||||
|
||||
it 'is added to the tag follower' do
|
||||
expect(home_feed_of(tagf)).to include status.id
|
||||
end
|
||||
|
||||
it 'is broadcast to the hashtag stream' do
|
||||
expect(redis).to have_received(:publish).with('timeline:hashtag:hoge', anything)
|
||||
expect(redis).to have_received(:publish).with('timeline:hashtag:hoge:local', anything)
|
||||
|
@ -265,6 +273,10 @@ RSpec.describe FanOutOnWriteService, type: :service do
|
|||
expect(home_feed_of(tom)).to_not include status.id
|
||||
end
|
||||
|
||||
it 'is not added to the tag follower' do
|
||||
expect(home_feed_of(tagf)).to_not include status.id
|
||||
end
|
||||
|
||||
it 'is not broadcast publicly' do
|
||||
expect(redis).to_not have_received(:publish).with('timeline:hashtag:hoge', anything)
|
||||
expect(redis).to_not have_received(:publish).with('timeline:public', anything)
|
||||
|
@ -321,6 +333,10 @@ RSpec.describe FanOutOnWriteService, type: :service do
|
|||
expect(home_feed_of(tom)).to include status.id
|
||||
end
|
||||
|
||||
it 'is not added to the tag follower' do
|
||||
expect(home_feed_of(tagf)).to_not include status.id
|
||||
end
|
||||
|
||||
it 'is not broadcast publicly' do
|
||||
expect(redis).to_not have_received(:publish).with('timeline:hashtag:hoge', anything)
|
||||
expect(redis).to_not have_received(:publish).with('timeline:public', anything)
|
||||
|
@ -394,6 +410,10 @@ RSpec.describe FanOutOnWriteService, type: :service do
|
|||
expect(home_feed_of(tom)).to include status.id
|
||||
end
|
||||
|
||||
it 'is added to the tag follower' do
|
||||
expect(home_feed_of(tagf)).to include status.id
|
||||
end
|
||||
|
||||
it 'is broadcast publicly' do
|
||||
expect(redis).to have_received(:publish).with('timeline:hashtag:hoge', anything)
|
||||
expect(redis).to have_received(:publish).with('timeline:public:local', anything)
|
||||
|
@ -509,6 +529,10 @@ RSpec.describe FanOutOnWriteService, type: :service do
|
|||
expect(home_feed_of(tom)).to include status.id
|
||||
end
|
||||
|
||||
it 'is added to the tag follower' do
|
||||
expect(home_feed_of(tagf)).to include status.id
|
||||
end
|
||||
|
||||
it 'is not broadcast publicly' do
|
||||
expect(redis).to have_received(:publish).with('timeline:hashtag:hoge', anything)
|
||||
expect(redis).to_not have_received(:publish).with('timeline:public', anything)
|
||||
|
@ -517,10 +541,14 @@ RSpec.describe FanOutOnWriteService, type: :service do
|
|||
context 'with searchability public_unlisted' do
|
||||
let(:searchability) { 'public_unlisted' }
|
||||
|
||||
it 'is not broadcast to the hashtag stream' do
|
||||
it 'is broadcast to the hashtag stream' do
|
||||
expect(redis).to have_received(:publish).with('timeline:hashtag:hoge', anything)
|
||||
expect(redis).to have_received(:publish).with('timeline:hashtag:hoge:local', anything)
|
||||
end
|
||||
|
||||
it 'is added to the tag follower' do
|
||||
expect(home_feed_of(tagf)).to include status.id
|
||||
end
|
||||
end
|
||||
|
||||
context 'with searchability private' do
|
||||
|
@ -530,6 +558,10 @@ RSpec.describe FanOutOnWriteService, type: :service do
|
|||
expect(redis).to_not have_received(:publish).with('timeline:hashtag:hoge', anything)
|
||||
expect(redis).to_not have_received(:publish).with('timeline:hashtag:hoge:local', anything)
|
||||
end
|
||||
|
||||
it 'is not added to the tag follower' do
|
||||
expect(home_feed_of(tagf)).to_not include status.id
|
||||
end
|
||||
end
|
||||
|
||||
context 'when local timeline is disabled' do
|
||||
|
@ -621,6 +653,10 @@ RSpec.describe FanOutOnWriteService, type: :service do
|
|||
expect(home_feed_of(tom)).to_not include status.id
|
||||
end
|
||||
|
||||
it 'is not added to the tag follower' do
|
||||
expect(home_feed_of(tagf)).to_not include status.id
|
||||
end
|
||||
|
||||
it 'is not broadcast publicly' do
|
||||
expect(redis).to_not have_received(:publish).with('timeline:hashtag:hoge', anything)
|
||||
expect(redis).to_not have_received(:publish).with('timeline:public', anything)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue