Add: 検索許可「ローカルとフォロワー」 (#60)
This commit is contained in:
parent
deb8642e95
commit
235bef36d0
24 changed files with 210 additions and 25 deletions
|
@ -137,6 +137,15 @@ RSpec.describe Status do
|
|||
end
|
||||
end
|
||||
|
||||
context 'when public-public_unlisted but silenced' do
|
||||
let(:silenced_at) { Time.now.utc }
|
||||
let(:status_searchability) { :public_unlisted }
|
||||
|
||||
it 'returns private' do
|
||||
expect(subject.compute_searchability).to eq 'private'
|
||||
end
|
||||
end
|
||||
|
||||
context 'when public-private' do
|
||||
let(:status_searchability) { :private }
|
||||
|
||||
|
@ -215,6 +224,24 @@ RSpec.describe Status do
|
|||
expect(subject.compute_searchability).to eq 'public'
|
||||
end
|
||||
end
|
||||
|
||||
context 'when public-public_unlisted of local account' do
|
||||
let(:account_searchability) { :public }
|
||||
let(:account_domain) { nil }
|
||||
let(:status_searchability) { :public_unlisted }
|
||||
|
||||
it 'returns public' do
|
||||
expect(subject.compute_searchability).to eq 'public'
|
||||
end
|
||||
|
||||
it 'returns public_unlisted for local' do
|
||||
expect(subject.compute_searchability_local).to eq 'public_unlisted'
|
||||
end
|
||||
|
||||
it 'returns private for activitypub' do
|
||||
expect(subject.compute_searchability_activitypub).to eq 'private'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#quote' do
|
||||
|
|
|
@ -91,18 +91,36 @@ describe TagFeed, type: :service do
|
|||
expect(results).to include status_tagged_with_cats
|
||||
end
|
||||
|
||||
it 'unlisted/public_unlisted_searchability post returns' do
|
||||
status_tagged_with_cats.update(visibility: :unlisted, searchability: :public_unlisted)
|
||||
results = described_class.new(tag_cats, nil).get(20)
|
||||
expect(results).to include status_tagged_with_cats
|
||||
end
|
||||
|
||||
it 'unlisted/public_searchability post returns with account' do
|
||||
status_tagged_with_cats.update(visibility: :unlisted, searchability: :public)
|
||||
results = described_class.new(tag_cats, account).get(20)
|
||||
expect(results).to include status_tagged_with_cats
|
||||
end
|
||||
|
||||
it 'unlisted/public_unlisted_searchability post returns with account' do
|
||||
status_tagged_with_cats.update(visibility: :unlisted, searchability: :public_unlisted)
|
||||
results = described_class.new(tag_cats, account).get(20)
|
||||
expect(results).to include status_tagged_with_cats
|
||||
end
|
||||
|
||||
it 'private post not returns' do
|
||||
status_tagged_with_cats.update(visibility: :private, searchability: :public)
|
||||
results = described_class.new(tag_cats, nil).get(20)
|
||||
expect(results).to_not include status_tagged_with_cats
|
||||
end
|
||||
|
||||
it 'private, public_unlisted post not returns' do
|
||||
status_tagged_with_cats.update(visibility: :private, searchability: :public_unlisted)
|
||||
results = described_class.new(tag_cats, nil).get(20)
|
||||
expect(results).to_not include status_tagged_with_cats
|
||||
end
|
||||
|
||||
it 'private post not returns with account' do
|
||||
status_tagged_with_cats.update(visibility: :private, searchability: :public)
|
||||
results = described_class.new(tag_cats, account).get(20)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue