Add Account.without_internal scope (#29559)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
@@ -888,7 +888,7 @@ RSpec.describe Account do
|
||||
{ username: 'b', domain: 'b' },
|
||||
].map(&method(:Fabricate).curry(2).call(:account))
|
||||
|
||||
expect(described_class.where('id > 0').alphabetic).to eq matches
|
||||
expect(described_class.without_internal.alphabetic).to eq matches
|
||||
end
|
||||
end
|
||||
|
||||
@@ -939,7 +939,7 @@ RSpec.describe Account do
|
||||
it 'returns an array of accounts who do not have a domain' do
|
||||
local_account = Fabricate(:account, domain: nil)
|
||||
_account_with_domain = Fabricate(:account, domain: 'example.com')
|
||||
expect(described_class.where('id > 0').local).to contain_exactly(local_account)
|
||||
expect(described_class.without_internal.local).to contain_exactly(local_account)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -950,14 +950,14 @@ RSpec.describe Account do
|
||||
matches[index] = Fabricate(:account, domain: matches[index])
|
||||
end
|
||||
|
||||
expect(described_class.where('id > 0').partitioned).to match_array(matches)
|
||||
expect(described_class.without_internal.partitioned).to match_array(matches)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'recent' do
|
||||
it 'returns a relation of accounts sorted by recent creation' do
|
||||
matches = Array.new(2) { Fabricate(:account) }
|
||||
expect(described_class.where('id > 0').recent).to match_array(matches)
|
||||
expect(described_class.without_internal.recent).to match_array(matches)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user