diff --git a/tests/Feature/NoteServiceTest.php b/tests/Feature/NoteServiceTest.php new file mode 100644 index 00000000..a7b44db1 --- /dev/null +++ b/tests/Feature/NoteServiceTest.php @@ -0,0 +1,60 @@ +createNote([ + 'content' => 'Hello Fred', + 'in-reply-to' => 'https://fredbloggs.com/note/abc', + 'syndicate' => ['twitter'], + ]); + + Queue::assertPushed(SyndicateToTwitter::class); + } + + public function test_syndicate_to_facebook_job_is_sent() + { + Queue::fake(); + + $noteService = new NoteService(); + $note = $noteService->createNote([ + 'content' => 'Hello Fred', + 'in-reply-to' => 'https://fredbloggs.com/note/abc', + 'syndicate' => ['facebook'], + ]); + + Queue::assertPushed(SyndicateToFacebook::class); + } + + public function test_syndicate_to_target_jobs_are_sent() + { + Queue::fake(); + + $noteService = new NoteService(); + $note = $noteService->createNote([ + 'content' => 'Hello Fred', + 'in-reply-to' => 'https://fredbloggs.com/note/abc', + 'syndicate' => ['twitter', 'facebook'], + ]); + + Queue::assertPushed(SyndicateToTwitter::class); + Queue::assertPushed(SyndicateToFacebook::class); + } +}