File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use Binafy \LaravelUserMonitoring \Models \ActionMonitoring ;
4+ use Illuminate \Foundation \Testing \RefreshDatabase ;
5+ use Tests \SetUp \Models \Product ;
6+ use function Pest \Laravel \{assertDatabaseCount , delete , get };
7+
8+ /*
9+ * Use `RefreshDatabase` for delete migration data for each test.
10+ */
11+ uses (RefreshDatabase::class);
12+
13+ test ('index authentications-monitoring is return correct view with data ' , function () {
14+ $ response = get (route ('user-monitoring.authentications-monitoring ' ));
15+ $ response ->assertViewIs ('LaravelUserMonitoring::authentications-monitoring.index ' );
16+ $ response ->assertViewHas ('authentications ' );
17+ });
18+
19+ test ('delete authentications-monitoring route delete action monitoring and redirect ' , function () {
20+ $ user = createUser ();
21+ auth ()->login ($ user );
22+
23+ $ response = delete (route ('user-monitoring.authentications-monitoring-delete ' , 1 ));
24+ $ response ->assertRedirect (route ('user-monitoring.authentications-monitoring ' ));
25+
26+ // DB Assertions
27+ assertDatabaseCount (config ('user-monitoring.action_monitoring.table ' ), 0 );
28+ });
You can’t perform that action at this time.
0 commit comments