0
0
Fork 0

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

@ -10,13 +10,13 @@ RSpec.describe UnblockService do
describe 'local' do
let(:bob) { Fabricate(:account) }
before do
sender.block!(bob)
subject.call(sender, bob)
end
before { sender.block!(bob) }
it 'destroys the blocking relation' do
expect(sender.blocking?(bob)).to be false
subject.call(sender, bob)
expect(sender)
.to_not be_blocking(bob)
end
end
@ -26,15 +26,15 @@ RSpec.describe UnblockService do
before do
sender.block!(bob)
stub_request(:post, 'http://example.com/inbox').to_return(status: 200)
end
it 'destroys the blocking relation and sends unblock activity', :inline_jobs do
subject.call(sender, bob)
end
it 'destroys the blocking relation' do
expect(sender.blocking?(bob)).to be false
end
it 'sends an unblock activity', :inline_jobs do
expect(a_request(:post, 'http://example.com/inbox')).to have_been_made.once
expect(sender)
.to_not be_blocking(bob)
expect(a_request(:post, 'http://example.com/inbox'))
.to have_been_made.once
end
end
end