* Bump version to 8.0 * Add: 他のサーバーに公開する情報に、制限設定などを追加 * Fix: `quote_of_id`のインデックス * Fix: #172 他のサーバーからの相乗り絵文字削除が反映されない * Test: #166 リモートから自分の絵文字を受け取った時、ライセンスが上書きされないことを確認するテスト * Add: #62 ローカルタイムラインを無効にする管理者設定(内部挙動のみ) * Add: 画面部分を追加
This commit is contained in:
parent
ae865975d4
commit
1d8862712a
21 changed files with 238 additions and 16 deletions
|
@ -5,6 +5,8 @@ require 'rails_helper'
|
|||
RSpec.describe DeliveryAntennaService, type: :service do
|
||||
subject { described_class.new }
|
||||
|
||||
let(:ltl_enabled) { true }
|
||||
|
||||
let(:last_active_at) { Time.now.utc }
|
||||
let(:last_active_at_tom) { Time.now.utc }
|
||||
let(:visibility) { :public }
|
||||
|
@ -36,6 +38,8 @@ RSpec.describe DeliveryAntennaService, type: :service do
|
|||
bob.follow!(alice)
|
||||
alice.block!(ohagi)
|
||||
|
||||
Form::AdminSettings.new(enable_local_timeline: '0').save unless ltl_enabled
|
||||
|
||||
allow(redis).to receive(:publish)
|
||||
|
||||
subject.call(status, false, mode: mode)
|
||||
|
@ -124,6 +128,29 @@ RSpec.describe DeliveryAntennaService, type: :service do
|
|||
end
|
||||
end
|
||||
|
||||
context 'with local domain' do
|
||||
let(:domain) { nil }
|
||||
let!(:antenna) { antenna_with_domain(bob, 'cb6e6126.ngrok.io') }
|
||||
let!(:empty_antenna) { antenna_with_domain(tom, 'ohagi.example.com') }
|
||||
|
||||
it 'detecting antenna' do
|
||||
expect(antenna_feed_of(antenna)).to include status.id
|
||||
end
|
||||
|
||||
it 'not detecting antenna' do
|
||||
expect(antenna_feed_of(empty_antenna)).to_not include status.id
|
||||
end
|
||||
|
||||
context 'when local timeline is disabled' do
|
||||
let(:ltl_enabled) { false }
|
||||
|
||||
it 'not detecting antenna' do
|
||||
expect(antenna_feed_of(antenna)).to_not include status.id
|
||||
expect(antenna_feed_of(empty_antenna)).to_not include status.id
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'with tag' do
|
||||
let!(:antenna) { antenna_with_tag(bob, 'hoge') }
|
||||
let!(:empty_antenna) { antenna_with_tag(tom, 'hog') }
|
||||
|
|
|
@ -5,6 +5,8 @@ require 'rails_helper'
|
|||
RSpec.describe FanOutOnWriteService, type: :service do
|
||||
subject { described_class.new }
|
||||
|
||||
let(:ltl_enabled) { true }
|
||||
|
||||
let(:last_active_at) { Time.now.utc }
|
||||
let(:visibility) { 'public' }
|
||||
let(:searchability) { 'public' }
|
||||
|
@ -28,6 +30,8 @@ RSpec.describe FanOutOnWriteService, type: :service do
|
|||
tom.follow!(alice)
|
||||
ohagi.follow!(bob)
|
||||
|
||||
Form::AdminSettings.new(enable_local_timeline: '0').save unless ltl_enabled
|
||||
|
||||
ProcessMentionsService.new.call(status)
|
||||
ProcessHashtagsService.new.call(status)
|
||||
|
||||
|
@ -86,6 +90,20 @@ RSpec.describe FanOutOnWriteService, type: :service do
|
|||
expect(redis).to have_received(:publish).with('timeline:public:local', anything)
|
||||
end
|
||||
|
||||
context 'when local timeline is disabled' do
|
||||
let(:ltl_enabled) { false }
|
||||
|
||||
it 'is broadcast to the hashtag stream' do
|
||||
expect(redis).to have_received(:publish).with('timeline:hashtag:hoge', anything)
|
||||
expect(redis).to_not have_received(:publish).with('timeline:hashtag:hoge:local', anything)
|
||||
end
|
||||
|
||||
it 'is broadcast to the public stream' do
|
||||
expect(redis).to have_received(:publish).with('timeline:public', anything)
|
||||
expect(redis).to_not have_received(:publish).with('timeline:public:local', anything)
|
||||
end
|
||||
end
|
||||
|
||||
context 'with list' do
|
||||
let!(:list) { list_with_account(bob, alice) }
|
||||
let!(:empty_list) { Fabricate(:list, account: tom) }
|
||||
|
@ -130,6 +148,15 @@ RSpec.describe FanOutOnWriteService, type: :service do
|
|||
expect(antenna_feed_of(antenna)).to include status.id
|
||||
end
|
||||
end
|
||||
|
||||
context 'when local timeline is disabled' do
|
||||
let(:ltl_enabled) { false }
|
||||
|
||||
it 'is not added to the antenna feed of antenna follower' do
|
||||
expect(antenna_feed_of(antenna)).to_not include status.id
|
||||
expect(antenna_feed_of(empty_antenna)).to_not include status.id
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'with LTL antenna' do
|
||||
|
@ -148,6 +175,15 @@ RSpec.describe FanOutOnWriteService, type: :service do
|
|||
expect(antenna_feed_of(antenna)).to include status.id
|
||||
end
|
||||
end
|
||||
|
||||
context 'when local timeline is disabled' do
|
||||
let(:ltl_enabled) { false }
|
||||
|
||||
it 'is not added to the antenna feed of antenna follower' do
|
||||
expect(antenna_feed_of(antenna)).to_not include status.id
|
||||
expect(antenna_feed_of(empty_antenna)).to_not include status.id
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -255,6 +291,15 @@ RSpec.describe FanOutOnWriteService, type: :service do
|
|||
expect(antenna_feed_of(antenna)).to include status.id
|
||||
expect(antenna_feed_of(empty_antenna)).to_not include status.id
|
||||
end
|
||||
|
||||
context 'when local timeline is disabled' do
|
||||
let(:ltl_enabled) { false }
|
||||
|
||||
it 'is not added to the antenna feed of antenna follower' do
|
||||
expect(antenna_feed_of(antenna)).to_not include status.id
|
||||
expect(antenna_feed_of(empty_antenna)).to_not include status.id
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'with LTL antenna' do
|
||||
|
@ -263,6 +308,14 @@ RSpec.describe FanOutOnWriteService, type: :service do
|
|||
it 'is added to the antenna feed of antenna follower' do
|
||||
expect(antenna_feed_of(empty_antenna)).to_not include status.id
|
||||
end
|
||||
|
||||
context 'when local timeline is disabled' do
|
||||
let(:ltl_enabled) { false }
|
||||
|
||||
it 'is not added to the antenna feed of antenna follower' do
|
||||
expect(antenna_feed_of(empty_antenna)).to_not include status.id
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -284,6 +337,20 @@ RSpec.describe FanOutOnWriteService, type: :service do
|
|||
expect(redis).to have_received(:publish).with('timeline:public', anything)
|
||||
end
|
||||
|
||||
context 'when local timeline is disabled' do
|
||||
let(:ltl_enabled) { false }
|
||||
|
||||
it 'is broadcast to the hashtag stream' do
|
||||
expect(redis).to have_received(:publish).with('timeline:hashtag:hoge', anything)
|
||||
expect(redis).to_not have_received(:publish).with('timeline:hashtag:hoge:local', anything)
|
||||
end
|
||||
|
||||
it 'is broadcast to the public stream' do
|
||||
expect(redis).to have_received(:publish).with('timeline:public', anything)
|
||||
expect(redis).to_not have_received(:publish).with('timeline:public:local', anything)
|
||||
end
|
||||
end
|
||||
|
||||
context 'with list' do
|
||||
let!(:list) { list_with_account(bob, alice) }
|
||||
let!(:empty_list) { list_with_account(ohagi, bob) }
|
||||
|
@ -328,6 +395,15 @@ RSpec.describe FanOutOnWriteService, type: :service do
|
|||
expect(antenna_feed_of(antenna)).to include status.id
|
||||
end
|
||||
end
|
||||
|
||||
context 'when local timeline is disabled' do
|
||||
let(:ltl_enabled) { false }
|
||||
|
||||
it 'is not added to the antenna feed of antenna follower' do
|
||||
expect(antenna_feed_of(antenna)).to_not include status.id
|
||||
expect(antenna_feed_of(empty_antenna)).to_not include status.id
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'with LTL antenna' do
|
||||
|
@ -346,6 +422,15 @@ RSpec.describe FanOutOnWriteService, type: :service do
|
|||
expect(antenna_feed_of(antenna)).to include status.id
|
||||
end
|
||||
end
|
||||
|
||||
context 'when local timeline is disabled' do
|
||||
let(:ltl_enabled) { false }
|
||||
|
||||
it 'is not added to the antenna feed of antenna follower' do
|
||||
expect(antenna_feed_of(antenna)).to_not include status.id
|
||||
expect(antenna_feed_of(empty_antenna)).to_not include status.id
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -384,6 +469,15 @@ RSpec.describe FanOutOnWriteService, type: :service do
|
|||
end
|
||||
end
|
||||
|
||||
context 'when local timeline is disabled' do
|
||||
let(:ltl_enabled) { false }
|
||||
|
||||
it 'is broadcast to the hashtag stream' do
|
||||
expect(redis).to have_received(:publish).with('timeline:hashtag:hoge', anything)
|
||||
expect(redis).to_not have_received(:publish).with('timeline:hashtag:hoge:local', anything)
|
||||
end
|
||||
end
|
||||
|
||||
context 'with list' do
|
||||
let!(:list) { list_with_account(bob, alice) }
|
||||
let!(:empty_list) { list_with_account(ohagi, bob) }
|
||||
|
@ -412,6 +506,15 @@ RSpec.describe FanOutOnWriteService, type: :service do
|
|||
expect(antenna_feed_of(antenna)).to include status.id
|
||||
expect(antenna_feed_of(empty_antenna)).to_not include status.id
|
||||
end
|
||||
|
||||
context 'when local timeline is disabled' do
|
||||
let(:ltl_enabled) { false }
|
||||
|
||||
it 'is not added to the antenna feed of antenna follower' do
|
||||
expect(antenna_feed_of(antenna)).to_not include status.id
|
||||
expect(antenna_feed_of(empty_antenna)).to_not include status.id
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'with LTL antenna' do
|
||||
|
@ -420,6 +523,14 @@ RSpec.describe FanOutOnWriteService, type: :service do
|
|||
it 'is added to the antenna feed of antenna follower' do
|
||||
expect(antenna_feed_of(empty_antenna)).to_not include status.id
|
||||
end
|
||||
|
||||
context 'when local timeline is disabled' do
|
||||
let(:ltl_enabled) { false }
|
||||
|
||||
it 'is not added to the antenna feed of antenna follower' do
|
||||
expect(antenna_feed_of(empty_antenna)).to_not include status.id
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'with non-public searchability' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue