mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-04 03:25:14 +00:00
Add with_list_account scope to List model (#35539)
This commit is contained in:
parent
018e5e303f
commit
7cd3738c19
6 changed files with 28 additions and 4 deletions
|
|
@ -28,4 +28,26 @@ RSpec.describe List do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'Scopes' do
|
||||
describe '.with_list_account' do
|
||||
let(:alice) { Fabricate :account }
|
||||
let(:bob) { Fabricate :account }
|
||||
let(:list) { Fabricate :list }
|
||||
let(:other_list) { Fabricate :list }
|
||||
|
||||
before do
|
||||
Fabricate :follow, account: list.account, target_account: alice
|
||||
Fabricate :follow, account: other_list.account, target_account: bob
|
||||
Fabricate :list_account, list: list, account: alice
|
||||
Fabricate :list_account, list: other_list, account: bob
|
||||
end
|
||||
|
||||
it 'returns lists connected to the account' do
|
||||
expect(described_class.with_list_account(alice))
|
||||
.to include(list)
|
||||
.and not_include(other_list)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue