mirror of https://github.com/mastodon/mastodon
Remove `follow` creation from `ListAccount` fabricator (#31902)
This commit is contained in:
parent
474abf3c7f
commit
c54cbf7943
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
Fabricator(:list_account) do
|
Fabricator(:list_account) do
|
||||||
list
|
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
|
end
|
||||||
|
|
|
@ -9,7 +9,7 @@ RSpec.describe ListAccount do
|
||||||
let(:list) { Fabricate :list, account: follow.account }
|
let(:list) { Fabricate :list, account: follow.account }
|
||||||
|
|
||||||
it 'finds and sets the follow with the list account' do
|
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)
|
expect(list_account)
|
||||||
.to have_attributes(
|
.to have_attributes(
|
||||||
follow: eq(follow),
|
follow: eq(follow),
|
||||||
|
@ -23,7 +23,7 @@ RSpec.describe ListAccount do
|
||||||
let(:list) { Fabricate :list, account: follow_request.account }
|
let(:list) { Fabricate :list, account: follow_request.account }
|
||||||
|
|
||||||
it 'finds and sets the follow request with the list account' do
|
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)
|
expect(list_account)
|
||||||
.to have_attributes(
|
.to have_attributes(
|
||||||
follow: be_nil,
|
follow: be_nil,
|
||||||
|
@ -33,10 +33,8 @@ RSpec.describe ListAccount do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when list owner is the account' do
|
context 'when list owner is the account' do
|
||||||
let(:list) { Fabricate :list }
|
|
||||||
|
|
||||||
it 'does not set follow or follow request' do
|
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)
|
expect(list_account)
|
||||||
.to have_attributes(
|
.to have_attributes(
|
||||||
follow: be_nil,
|
follow: be_nil,
|
||||||
|
|
Loading…
Reference in New Issue