File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,14 @@ public function queueing_an_email_will_leave_sending_on_false()
2121 $ this ->assertEquals (0 , $ email ->sending );
2222 }
2323
24+ /** @test */
25+ public function queueing_an_email_will_set_the_queued_at_column ()
26+ {
27+ $ email = $ this ->queueEmail ();
28+
29+ $ this ->assertNotNull ($ email ->queued_at );
30+ }
31+
2432 /** @test */
2533 public function queueing_an_email_will_dispatch_a_job ()
2634 {
Original file line number Diff line number Diff line change 44
55use Carbon \Carbon ;
66use Illuminate \Support \Facades \DB ;
7+ use Illuminate \Support \Facades \Queue ;
78use Stackkit \LaravelDatabaseEmails \Store ;
89
910class SendEmailsCommandTest extends TestCase
@@ -45,6 +46,18 @@ public function an_email_should_not_be_sent_once_it_is_marked_as_sent()
4546 $ this ->assertEquals ($ firstSend , $ email ->fresh ()->getSendDate ());
4647 }
4748
49+ /** @test */
50+ public function an_email_should_not_be_sent_if_it_is_queued ()
51+ {
52+ Queue::fake ();
53+
54+ $ email = $ this ->queueEmail ();
55+
56+ $ this ->artisan ('email:send ' );
57+
58+ $ this ->assertNull ($ email ->fresh ()->getSendDate ());
59+ }
60+
4861 /** @test */
4962 public function if_an_email_fails_to_be_sent_it_should_be_logged_in_the_database ()
5063 {
You can’t perform that action at this time.
0 commit comments