File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
stubs/modules/Blog/Tests/Site Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change 88uses (TestCase::class, RefreshDatabase::class);
99
1010beforeEach (function () {
11- $ this ->post = Post::factory ()->create ();
11+ $ this ->post = Post::factory ()->create ([
12+ 'title ' => 'Test Post ' ,
13+ 'content ' => 'Test Content ' ,
14+ 'published_at ' => now ()->subDay (),
15+ ]);
1216});
1317
1418afterEach (function () {
1519 if ($ this ->post ->image ) {
16- Storage::disk ('public ' )->delete ('blog/ ' . $ this ->post ->image );
20+ Storage::disk ('public ' )->delete ('blog/ ' . $ this ->post ->image );
1721 }
1822});
1923
2024test ('blog index page can be rendered ' , function () {
25+ $ this ->withoutVite ();
2126 $ response = $ this ->get ('/blog ' );
2227
2328 $ response ->assertStatus (200 );
29+ $ response ->assertSee ('Blog ' );
30+ $ response ->assertSee ($ this ->post ->title );
31+ });
32+
33+ test ('blog post page can be rendered ' , function () {
34+ $ this ->withoutVite ();
35+ $ response = $ this ->get ('/blog/ ' . $ this ->post ->slug );
36+
37+ $ response ->assertStatus (200 );
38+ $ response ->assertSee ($ this ->post ->title );
39+ $ response ->assertSee ($ this ->post ->content );
2440});
You can’t perform that action at this time.
0 commit comments