mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-14 08:19:05 +00:00
Reduce factory usage across spec/services area (#32098)
This commit is contained in:
@@ -11,11 +11,9 @@ RSpec.describe FavouriteService do
|
||||
let(:bob) { Fabricate(:account) }
|
||||
let(:status) { Fabricate(:status, account: bob) }
|
||||
|
||||
before do
|
||||
subject.call(sender, status)
|
||||
end
|
||||
|
||||
it 'creates a favourite' do
|
||||
subject.call(sender, status)
|
||||
|
||||
expect(status.favourites.first).to_not be_nil
|
||||
end
|
||||
end
|
||||
@@ -26,15 +24,16 @@ RSpec.describe FavouriteService do
|
||||
|
||||
before do
|
||||
stub_request(:post, 'http://example.com/inbox').to_return(status: 200, body: '', headers: {})
|
||||
end
|
||||
|
||||
it 'creates a favourite and sends like activity', :inline_jobs do
|
||||
subject.call(sender, status)
|
||||
end
|
||||
|
||||
it 'creates a favourite' do
|
||||
expect(status.favourites.first).to_not be_nil
|
||||
end
|
||||
expect(status.favourites.first)
|
||||
.to_not be_nil
|
||||
|
||||
it 'sends a like activity', :inline_jobs do
|
||||
expect(a_request(:post, 'http://example.com/inbox')).to have_been_made.once
|
||||
expect(a_request(:post, 'http://example.com/inbox'))
|
||||
.to have_been_made.once
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user