Reduce factory usage across spec/services area (#32098)

This commit is contained in:
Matt Jankowski 2024-10-04 10:11:15 -04:00 committed by GitHub
parent 4fe7f213a6
commit e4e07b1c34
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 567 additions and 641 deletions

View file

@ -18,23 +18,19 @@ RSpec.describe UpdateAccountService do
FollowService.new.call(alice, account)
FollowService.new.call(bob, account)
FollowService.new.call(eve, account)
end
it 'auto accepts pending follow requests from appropriate accounts' do
subject.call(account, { locked: false })
end
it 'auto-accepts pending follow requests' do
expect(alice.following?(account)).to be true
expect(alice.requested?(account)).to be false
end
expect(alice).to be_following(account)
expect(alice).to_not be_requested(account)
it 'does not auto-accept pending follow requests from silenced users' do
expect(bob.following?(account)).to be false
expect(bob.requested?(account)).to be true
end
expect(bob).to_not be_following(account)
expect(bob).to be_requested(account)
it 'auto-accepts pending follow requests from muted users so as to not leak mute' do
expect(eve.following?(account)).to be true
expect(eve.requested?(account)).to be false
expect(eve).to be_following(account)
expect(eve).to_not be_requested(account)
end
end
end