Add: #40 拡張ドメインブロックに「トレンドに掲載しない」を追加 (#492)

This commit is contained in:
KMY(雪あすか) 2024-01-22 09:06:05 +09:00 committed by GitHub
parent 96da1fcb00
commit 8793bc286e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 71 additions and 10 deletions

View file

@ -57,6 +57,29 @@ RSpec.describe Trends::Statuses do
end
end
describe '#register for remote user' do
let(:account) { Fabricate(:account, searchability: :public, discoverable: true, domain: 'example.com', uri: 'https://example.com/actor') }
let(:status) { Fabricate(:status, account: account, searchability: :public, language: 'en') }
let(:domain_block) { false }
before do
Fabricate(:domain_block, domain: 'example.com', severity: :noop, block_trends: true) if domain_block
subject.register(status, at_time)
end
it 'records use' do
expect(subject.send(:recently_used_ids, at_time)).to eq [status.id]
end
context 'when domain-blocked' do
let(:domain_block) { true }
it 'does not record use' do
expect(subject.send(:recently_used_ids, at_time)).to eq []
end
end
end
describe '#query' do
it 'returns a composable query scope' do
expect(subject.query).to be_a Trends::Query