@@ -71,4 +71,38 @@ public function testItCanGenerateMailFileWithTest()
71
71
$ this ->assertFilenameNotExists ('resources/views/foo-mail.blade.php ' );
72
72
$ this ->assertFilenameExists ('tests/Feature/Mail/FooMailTest.php ' );
73
73
}
74
+
75
+ public function testItCanGenerateMailWithNoInitialInput ()
76
+ {
77
+ $ this ->artisan ('make:mail ' )
78
+ ->expectsQuestion ('What should the mailable be named? ' , 'FooMail ' )
79
+ ->expectsQuestion ('Would you like to create a view? ' , 'none ' )
80
+ ->assertExitCode (0 );
81
+
82
+ $ this ->assertFilenameExists ('app/Mail/FooMail.php ' );
83
+ $ this ->assertFilenameDoesNotExists ('resources/views/mail/foo-mail.blade.php ' );
84
+ }
85
+
86
+ public function testItCanGenerateMailWithViewWithNoInitialInput ()
87
+ {
88
+ $ this ->artisan ('make:mail ' )
89
+ ->expectsQuestion ('What should the mailable be named? ' , 'MyFooMail ' )
90
+ ->expectsQuestion ('Would you like to create a view? ' , 'view ' )
91
+ ->assertExitCode (0 );
92
+
93
+ $ this ->assertFilenameExists ('app/Mail/MyFooMail.php ' );
94
+ $ this ->assertFilenameExists ('resources/views/mail/my-foo-mail.blade.php ' );
95
+ }
96
+
97
+ public function testItCanGenerateMailWithMarkdownViewWithNoInitialInput ()
98
+ {
99
+ $ this ->artisan ('make:mail ' )
100
+
101
+ ->expectsQuestion ('What should the mailable be named? ' , 'FooMail ' )
102
+ ->expectsQuestion ('Would you like to create a view? ' , 'markdown ' )
103
+ ->assertExitCode (0 );
104
+
105
+ $ this ->assertFilenameExists ('app/Mail/MyFooMail.php ' );
106
+ $ this ->assertFilenameExists ('resources/views/mail/my-foo-mail.blade.php ' );
107
+ }
74
108
}
0 commit comments