Reduce factory usage across spec/services
area (#32098)
This commit is contained in:
parent
4fe7f213a6
commit
e4e07b1c34
21 changed files with 567 additions and 641 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue