File tree Expand file tree Collapse file tree 1 file changed +0
-20
lines changed
tests/Feature/API/V1/Admin/User Expand file tree Collapse file tree 1 file changed +0
-20
lines changed Original file line number Diff line number Diff line change 62
62
expect ($ userToBlock ->banned_at )->not ->toBeNull ();
63
63
});
64
64
65
- it ('can block an already blocked user (updates timestamp) ' , function () {
66
- // Arrange
67
- $ admin = User::factory ()->create ();
68
- $ adminRole = Role::where ('name ' , UserRole::ADMINISTRATOR ->value )->first ();
69
- $ admin ->roles ()->attach ($ adminRole ->id );
70
-
71
- $ oldBlockTime = now ()->subDays (5 );
72
- $ userToBlock = User::factory ()->create (['blocked_at ' => $ oldBlockTime ]);
73
-
74
- // Act
75
- $ response = $ this ->actingAs ($ admin )
76
- ->postJson (route ('api.v1.admin.users.block ' , $ userToBlock ->id ));
77
-
78
- // Assert
79
- $ response ->assertStatus (200 );
80
-
81
- $ userToBlock ->refresh ();
82
- expect ($ userToBlock ->blocked_at ->toDateTimeString ())->toBe (now ()->toDateTimeString ());
83
- });
84
-
85
65
it ('returns 404 when user does not exist ' , function () {
86
66
// Arrange
87
67
$ admin = User::factory ()->create ();
You can’t perform that action at this time.
0 commit comments