File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -62,15 +62,17 @@ public function testDepartmentIdNeedsToBeInteger()
6262
6363 public function testCanCreateUser ()
6464 {
65+ Notification::fake ();
66+
6567 $ this ->actingAsForApi (User::factory ()->createUsers ()->create ())
6668 ->postJson (route ('api.users.store ' ), [
6769 'first_name ' => 'Test First Name ' ,
6870 'last_name ' => 'Test Last Name ' ,
6971 'username ' => 'testuser ' ,
7072 'password ' => 'testpassword1235!! ' ,
7173 'password_confirmation ' => 'testpassword1235!! ' ,
72- 'send_welcome ' => '1 ' ,
7374 'activated ' => '1 ' ,
75+ 7476 'notes ' => 'Test Note ' ,
7577 ])
7678 ->assertStatusMessageIs ('success ' )
@@ -81,9 +83,12 @@ public function testCanCreateUser()
8183 'last_name ' => 'Test Last Name ' ,
8284 'username ' => 'testuser ' ,
8385 'activated ' => '1 ' ,
86+ 8487 'notes ' => 'Test Note ' ,
8588
8689 ]);
90+
91+ Notification::assertNothingSent ();
8792 }
8893
8994 public function testCanCreateAndNotifyUser ()
Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ public function testPageRenders()
2727
2828 public function testCanCreateUser ()
2929 {
30+ Notification::fake ();
31+
3032 $ response = $ this ->actingAs (User::factory ()->createUsers ()->viewUsers ()->create ())
3133 ->from (route ('users.index ' ))
3234 ->post (route ('users.store ' ), [
@@ -35,8 +37,8 @@ public function testCanCreateUser()
3537 'username ' => 'testuser ' ,
3638 'password ' => 'testpassword1235!! ' ,
3739 'password_confirmation ' => 'testpassword1235!! ' ,
38- 'send_welcome ' => '1 ' ,
3940 'activated ' => '1 ' ,
41+ 4042 'notes ' => 'Test Note ' ,
4143 ])
4244 ->assertSessionHasNoErrors ()
@@ -48,10 +50,11 @@ public function testCanCreateUser()
4850 'last_name ' => 'Test Last Name ' ,
4951 'username ' => 'testuser ' ,
5052 'activated ' => '1 ' ,
53+ 5154 'notes ' => 'Test Note ' ,
5255
5356 ]);
54-
57+ Notification:: assertNothingSent ();
5558 $ this ->followRedirects ($ response )->assertSee ('Success ' );
5659
5760 }
You can’t perform that action at this time.
0 commit comments