Merge remote-tracking branch 'parent/main' into upstream-20240124

This commit is contained in:
KMY 2024-01-24 08:38:14 +09:00
commit 54f5113b46
106 changed files with 1396 additions and 1071 deletions

View file

@ -1046,6 +1046,31 @@ RSpec.describe Account do
end
describe 'scopes' do
describe 'matches_uri_prefix' do
let!(:alice) { Fabricate :account, domain: 'host.example', uri: 'https://host.example/user/a' }
let!(:bob) { Fabricate :account, domain: 'top-level.example', uri: 'https://top-level.example' }
it 'returns accounts which start with the value' do
results = described_class.matches_uri_prefix('https://host.example')
expect(results.size)
.to eq(1)
expect(results)
.to include(alice)
.and not_include(bob)
end
it 'returns accounts which equal the value' do
results = described_class.matches_uri_prefix('https://top-level.example')
expect(results.size)
.to eq(1)
expect(results)
.to include(bob)
.and not_include(alice)
end
end
describe 'auditable' do
let!(:alice) { Fabricate :account }
let!(:bob) { Fabricate :account }