0
0
Fork 0

Fix deprecation warning about merging conditions (#23618)

This commit is contained in:
Matt Jankowski 2023-03-02 10:21:04 -05:00 committed by GitHub
parent 9da52ac044
commit af578e8ce0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 47 additions and 3 deletions

View file

@ -18,4 +18,30 @@ describe AccountFilter do
expect { filter.results }.to raise_error(/wrong/)
end
end
describe 'with origin and by_domain interacting' do
let!(:local_account) { Fabricate(:account, domain: nil) }
let!(:remote_account_one) { Fabricate(:account, domain: 'example.org') }
let(:remote_account_two) { Fabricate(:account, domain: 'other.domain') }
it 'works with domain first and origin remote' do
filter = described_class.new(by_domain: 'example.org', origin: 'remote')
expect(filter.results).to match_array [remote_account_one]
end
it 'works with domain last and origin remote' do
filter = described_class.new(origin: 'remote', by_domain: 'example.org')
expect(filter.results).to match_array [remote_account_one]
end
it 'works with domain first and origin local' do
filter = described_class.new(by_domain: 'example.org', origin: 'local')
expect(filter.results).to match_array [local_account]
end
it 'works with domain last and origin local' do
filter = described_class.new(origin: 'local', by_domain: 'example.org')
expect(filter.results).to match_array [remote_account_one]
end
end
end