Remove `follow` creation from `ListAccount` fabricator (#31902)

This commit is contained in:
Matt Jankowski 2024-09-16 04:56:40 -04:00 committed by GitHub
parent 474abf3c7f
commit c54cbf7943
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 7 deletions

View File

@ -2,6 +2,8 @@
Fabricator(:list_account) do
list
account
before_create { |list_account, _| list_account.list.account.follow!(account) }
initialize_with do
resolved_class.new(list: list, account: list.account)
end
end

View File

@ -9,7 +9,7 @@ RSpec.describe ListAccount do
let(:list) { Fabricate :list, account: follow.account }
it 'finds and sets the follow with the list account' do
list_account = described_class.create list: list, account: follow.target_account
list_account = Fabricate :list_account, list: list, account: follow.target_account
expect(list_account)
.to have_attributes(
follow: eq(follow),
@ -23,7 +23,7 @@ RSpec.describe ListAccount do
let(:list) { Fabricate :list, account: follow_request.account }
it 'finds and sets the follow request with the list account' do
list_account = described_class.create list: list, account: follow_request.target_account
list_account = Fabricate :list_account, list: list, account: follow_request.target_account
expect(list_account)
.to have_attributes(
follow: be_nil,
@ -33,10 +33,8 @@ RSpec.describe ListAccount do
end
context 'when list owner is the account' do
let(:list) { Fabricate :list }
it 'does not set follow or follow request' do
list_account = described_class.create list: list, account: list.account
list_account = Fabricate :list_account
expect(list_account)
.to have_attributes(
follow: be_nil,