File tree 2 files changed +21
-0
lines changed
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()
21
21
$ this ->assertEquals (0 , $ email ->sending );
22
22
}
23
23
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
+
24
32
/** @test */
25
33
public function queueing_an_email_will_dispatch_a_job ()
26
34
{
Original file line number Diff line number Diff line change 4
4
5
5
use Carbon \Carbon ;
6
6
use Illuminate \Support \Facades \DB ;
7
+ use Illuminate \Support \Facades \Queue ;
7
8
use Stackkit \LaravelDatabaseEmails \Store ;
8
9
9
10
class SendEmailsCommandTest extends TestCase
@@ -45,6 +46,18 @@ public function an_email_should_not_be_sent_once_it_is_marked_as_sent()
45
46
$ this ->assertEquals ($ firstSend , $ email ->fresh ()->getSendDate ());
46
47
}
47
48
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
+
48
61
/** @test */
49
62
public function if_an_email_fails_to_be_sent_it_should_be_logged_in_the_database ()
50
63
{
You can’t perform that action at this time.
0 commit comments