mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 14:06:15 +00:00
User management (#185)
This commit is contained in:
@ -14,7 +14,7 @@ public function test_create_project(): void
|
||||
{
|
||||
$this->actingAs($this->user);
|
||||
|
||||
$this->post(route('projects.create'), [
|
||||
$this->post(route('settings.projects.create'), [
|
||||
'name' => 'test',
|
||||
])->assertSessionDoesntHaveErrors();
|
||||
|
||||
@ -27,11 +27,11 @@ public function test_see_projects_list(): void
|
||||
{
|
||||
$this->actingAs($this->user);
|
||||
|
||||
$project = Project::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
]);
|
||||
$project = Project::factory()->create();
|
||||
|
||||
$this->get(route('projects'))
|
||||
$this->user->projects()->attach($project);
|
||||
|
||||
$this->get(route('settings.projects'))
|
||||
->assertSuccessful()
|
||||
->assertSee($project->name);
|
||||
}
|
||||
@ -40,11 +40,11 @@ public function test_delete_project(): void
|
||||
{
|
||||
$this->actingAs($this->user);
|
||||
|
||||
$project = Project::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
]);
|
||||
$project = Project::factory()->create();
|
||||
|
||||
$this->delete(route('projects.delete', $project))
|
||||
$this->user->projects()->attach($project);
|
||||
|
||||
$this->delete(route('settings.projects.delete', $project))
|
||||
->assertSessionDoesntHaveErrors();
|
||||
|
||||
$this->assertDatabaseMissing('projects', [
|
||||
@ -56,11 +56,11 @@ public function test_edit_project(): void
|
||||
{
|
||||
$this->actingAs($this->user);
|
||||
|
||||
$project = Project::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
]);
|
||||
$project = Project::factory()->create();
|
||||
|
||||
$this->post(route('projects.update', $project), [
|
||||
$this->user->projects()->attach($project);
|
||||
|
||||
$this->post(route('settings.projects.update', $project), [
|
||||
'name' => 'new-name',
|
||||
])->assertSessionDoesntHaveErrors();
|
||||
|
||||
@ -74,7 +74,7 @@ public function test_cannot_delete_last_project(): void
|
||||
{
|
||||
$this->actingAs($this->user);
|
||||
|
||||
$this->delete(route('projects.delete', [
|
||||
$this->delete(route('settings.projects.delete', [
|
||||
'project' => $this->user->currentProject,
|
||||
]))
|
||||
->assertSessionDoesntHaveErrors()
|
||||
|
Reference in New Issue
Block a user