File tree 6 files changed +6
-10
lines changed
6 files changed +6
-10
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
3
use App \Models \User ;
4
- use App \Providers \RouteServiceProvider ;
5
4
6
5
test ('login screen can be rendered ' , function () {
7
6
$ response = $ this ->get ('/login ' );
18
17
]);
19
18
20
19
$ this ->assertAuthenticated ();
21
- $ response ->assertRedirect (RouteServiceProvider:: HOME );
20
+ $ response ->assertRedirect (route ( ' dashboard ' , absolute: false ) );
22
21
});
23
22
24
23
test ('users cannot authenticate with invalid password ' , function () {
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
3
use App \Models \User ;
4
- use App \Providers \RouteServiceProvider ;
5
4
use Illuminate \Auth \Events \Verified ;
6
5
use Illuminate \Support \Facades \Event ;
7
6
use Illuminate \Support \Facades \URL ;
37
36
Event::assertDispatched (Verified::class);
38
37
39
38
expect ($ user ->fresh ()->hasVerifiedEmail ())->toBeTrue ();
40
- $ response ->assertRedirect (RouteServiceProvider:: HOME .'?verified=1 ' );
39
+ $ response ->assertRedirect (route ( ' dashboard ' , absolute: false ) .'?verified=1 ' );
41
40
})->skip (function () {
42
41
return ! Features::enabled (Features::emailVerification ());
43
42
}, 'Email verification not enabled. ' );
Original file line number Diff line number Diff line change 30
30
]);
31
31
32
32
$ this ->assertAuthenticated ();
33
- $ response ->assertRedirect (RouteServiceProvider:: HOME );
33
+ $ response ->assertRedirect (route ( ' dashboard ' , absolute: false ) );
34
34
})->skip (function () {
35
35
return ! Features::enabled (Features::registration ());
36
36
}, 'Registration support is not enabled. ' );
Original file line number Diff line number Diff line change 3
3
namespace Tests \Feature ;
4
4
5
5
use App \Models \User ;
6
- use App \Providers \RouteServiceProvider ;
7
6
use Illuminate \Foundation \Testing \RefreshDatabase ;
8
7
use Tests \TestCase ;
9
8
@@ -28,7 +27,7 @@ public function test_users_can_authenticate_using_the_login_screen(): void
28
27
]);
29
28
30
29
$ this ->assertAuthenticated ();
31
- $ response ->assertRedirect (RouteServiceProvider:: HOME );
30
+ $ response ->assertRedirect (route ( ' dashboard ' , absolute: false ) );
32
31
}
33
32
34
33
public function test_users_can_not_authenticate_with_invalid_password (): void
Original file line number Diff line number Diff line change 3
3
namespace Tests \Feature ;
4
4
5
5
use App \Models \User ;
6
- use App \Providers \RouteServiceProvider ;
7
6
use Illuminate \Auth \Events \Verified ;
8
7
use Illuminate \Foundation \Testing \RefreshDatabase ;
9
8
use Illuminate \Support \Facades \Event ;
@@ -53,7 +52,7 @@ public function test_email_can_be_verified(): void
53
52
Event::assertDispatched (Verified::class);
54
53
55
54
$ this ->assertTrue ($ user ->fresh ()->hasVerifiedEmail ());
56
- $ response ->assertRedirect (RouteServiceProvider:: HOME .'?verified=1 ' );
55
+ $ response ->assertRedirect (route ( ' dashboard ' , absolute: false ) .'?verified=1 ' );
57
56
}
58
57
59
58
public function test_email_can_not_verified_with_invalid_hash (): void
Original file line number Diff line number Diff line change @@ -55,6 +55,6 @@ public function test_new_users_can_register(): void
55
55
]);
56
56
57
57
$ this ->assertAuthenticated ();
58
- $ response ->assertRedirect (RouteServiceProvider:: HOME );
58
+ $ response ->assertRedirect (route ( ' dashboard ' , absolute: false ) );
59
59
}
60
60
}
You can’t perform that action at this time.
0 commit comments