File tree Expand file tree Collapse file tree 3 files changed +5
-24
lines changed Expand file tree Collapse file tree 3 files changed +5
-24
lines changed Original file line number Diff line number Diff line change 1717 );
1818});
1919
20- test ("Guests can't edit any accounts " , function () {
20+ test ("Guests can't edit accounts " , function () {
2121 get (route ('account.edit ' ))->assertRedirect (route ('login ' ));
2222});
2323
4343 'email ' => 'tim@test.com ' ,
4444 'password ' => 'newPassword#123 ' ,
4545 ])
46- ->assertRedirect ();
46+ ->assertRedirect ()
47+ ->assertSessionHas ('message ' , 'Your account has been updated. ' );
4748
4849 $ user ->refresh ();
4950
5556 expect (Hash::check ('newPassword#123 ' , $ user ->password ))->toBeTrue ();
5657});
5758
58- test ("Guests can't update any details " , function () {
59+ test ("Guests can't update details " , function () {
5960 patch (route ('account.update ' ), [
6061 'name ' => 'Tim Drake ' ,
6162 'email ' => 'tim@test.com ' ,
Original file line number Diff line number Diff line change 6363 'email ' => $ user ->email ,
6464 'password ' => 'test ' ,
6565 ])
66- ->assertsessionHasErrors (' email ' );
66+ ->assertsessionHasErrors ();
6767
6868 assertGuest ();
6969});
Original file line number Diff line number Diff line change 33use App \Models \User ;
44use Illuminate \Support \Facades \Hash ;
55
6- it ('has a first name ' , function () {
7- $ firstName = 'Jim ' ;
8-
9- $ user = User::factory ()->create ([
10- 'first_name ' => $ firstName ,
11- ]);
12-
13- expect ($ user )->first_name ->toBe ($ firstName );
14- });
15-
16- it ('has a last name ' , function () {
17- $ lastName = 'Gordon ' ;
18-
19- $ user = User::factory ()->create ([
20- 'last_name ' => $ lastName ,
21- ]);
22-
23- expect ($ user )->last_name ->toBe ($ lastName );
24- });
25-
266it ("can update it's password " , function () {
277 $ user = User::factory ()->create ([
288 'password ' => 'oldPassword#123 ' ,
You can’t perform that action at this time.
0 commit comments