new role functionality
This commit is contained in:
@@ -21,3 +21,18 @@ test('authenticated users can view the role index', function () {
|
||||
->assertSee('Admin')
|
||||
->assertSee('Editor');
|
||||
});
|
||||
|
||||
test('authenticated users can create a role', function () {
|
||||
$response = $this
|
||||
->actingAs(User::factory()->create())
|
||||
->post('/role', [
|
||||
'name' => 'Manager',
|
||||
]);
|
||||
|
||||
$response
|
||||
->assertRedirect('/role');
|
||||
|
||||
$this->assertDatabaseHas('roles', [
|
||||
'name' => 'Manager',
|
||||
]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user