Change: 時限投稿はフォロワー以外にはActivityを発行しない (#250)
* Change: 時限投稿はフォロワー以外にはActivityを発行しない * Fix: ドメイン単位の認証になるように * Add test and fix * Fix lint * Fix test * Fix test * Revert "Fix test" This reverts commit22f1114b7f
. * Revert "Fix lint" This reverts commita828efa9be
. * Revert "Revert "Fix lint"" This reverts commit6a2d68f28a
. * Revert "Revert "Fix test"" This reverts commita21c0b9d3e
.
This commit is contained in:
parent
faf791c602
commit
789afccf9b
5 changed files with 66 additions and 1 deletions
|
@ -381,6 +381,43 @@ describe Account::Interactions do
|
|||
end
|
||||
end
|
||||
|
||||
describe '#followed_by_domain?' do
|
||||
subject { account.followed_by_domain?('example.com') }
|
||||
|
||||
let(:target_account) { Fabricate(:account, domain: 'example.com', uri: 'https://example.com/actor') }
|
||||
|
||||
context 'when followed by target_account' do
|
||||
it 'returns true' do
|
||||
account.passive_relationships.create(account: target_account)
|
||||
expect(subject).to be true
|
||||
end
|
||||
end
|
||||
|
||||
context 'when not followed by target_account' do
|
||||
it 'returns false' do
|
||||
expect(subject).to be false
|
||||
end
|
||||
end
|
||||
|
||||
context 'with status' do
|
||||
subject { account.followed_by_domain?('example.com', '2022/12/24 10:00:00') }
|
||||
|
||||
context 'when followed by target_account since the time' do
|
||||
it 'returns true' do
|
||||
account.passive_relationships.create(account: target_account, created_at: '2022/12/22 10:00:00')
|
||||
expect(subject).to be true
|
||||
end
|
||||
end
|
||||
|
||||
context 'when followed by target_account after the time' do
|
||||
it 'returns false' do
|
||||
account.passive_relationships.create(account: target_account, created_at: '2022/12/26 10:00:00')
|
||||
expect(subject).to be false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#blocking?' do
|
||||
subject { account.blocking?(target_account) }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue