File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 5959 assertDatabaseMissing (config ('user-monitoring.visit_monitoring.table ' ), ['page ' => url ('/ ' )]);
6060});
6161
62+ // Ajax
63+
64+ test ('visit monitoring store ajax requests ' , function () {
65+ get ('/ ' , ['X-Requested-With ' => 'XMLHttpRequest ' ]);
66+
67+ // DB Assertions
68+ assertDatabaseCount (config ('user-monitoring.visit_monitoring.table ' ), 1 );
69+ assertDatabaseHas (config ('user-monitoring.visit_monitoring.table ' ), ['created_at ' => now ()]);
70+ });
71+
72+ test ('visit monitoring skip store when ajax mode is off for ajax requests ' , function () {
73+ config ()->set ('user-monitoring.visit_monitoring.ajax_requests ' , false );
74+
75+ get ('/ ' , ['X-Requested-With ' => 'XMLHttpRequest ' ]);
76+
77+ // DB Assertions
78+ assertDatabaseCount (config ('user-monitoring.visit_monitoring.table ' ), 0 );
79+ assertDatabaseMissing (config ('user-monitoring.visit_monitoring.table ' ), ['page ' => 'http:\/\/localhost ' ]);
80+ });
81+
6282/**
6383 * Create user.
6484 *
You can’t perform that action at this time.
0 commit comments