Add: 検索許可「ローカルとフォロワー」 (#60)

This commit is contained in:
KMY(雪あすか) 2023-10-05 16:37:27 +09:00 committed by GitHub
parent deb8642e95
commit 235bef36d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 210 additions and 25 deletions

View file

@ -127,6 +127,13 @@ RSpec.describe PostStatusService, type: :service do
expect(status.searchability).to eq 'private'
end
it 'creates a status with limited searchability for silenced users with public_unlisted searchability' do
status = subject.call(Fabricate(:account, silenced: true), text: 'test', searchability: :public_unlisted, visibility: :public)
expect(status).to be_persisted
expect(status.searchability).to eq 'private'
end
it 'creates a status with the given searchability=public / visibility=unlisted' do
status = create_status_with_options(searchability: :public, visibility: :unlisted)
@ -134,6 +141,13 @@ RSpec.describe PostStatusService, type: :service do
expect(status.searchability).to eq 'public'
end
it 'creates a status with the given searchability=public_unlisted / visibility=unlisted' do
status = create_status_with_options(searchability: :public_unlisted, visibility: :unlisted)
expect(status).to be_persisted
expect(status.searchability).to eq 'public_unlisted'
end
it 'creates a status with the given searchability=public / visibility=private' do
status = create_status_with_options(searchability: :public, visibility: :private)
@ -141,6 +155,13 @@ RSpec.describe PostStatusService, type: :service do
expect(status.searchability).to eq 'private'
end
it 'creates a status with the given searchability=public_unlisted / visibility=private' do
status = create_status_with_options(searchability: :public_unlisted, visibility: :private)
expect(status).to be_persisted
expect(status.searchability).to eq 'private'
end
it 'creates a status for the given application' do
application = Fabricate(:application)