users and institutions route, tests fixed

This commit is contained in:
Giuseppe Naponiello
2026-06-23 12:29:02 +02:00
parent fe73662903
commit 032f6a08df
23 changed files with 346 additions and 287 deletions

View File

@@ -140,10 +140,18 @@ class InstitutionLinkControllerTest extends TestCase
$this->postJson("/api/institutions/{$institution->uuid}/links", $this->validPayload())->assertForbidden();
}
public function test_guests_cannot_access_links(): void
public function test_guests_can_read_links(): void
{
$institution = Institution::factory()->create();
InstitutionLink::factory()->create(['institution_id' => $institution->id]);
$this->getJson("/api/institutions/{$institution->uuid}/links")->assertOk();
}
public function test_guests_cannot_write_links(): void
{
$institution = Institution::factory()->create();
$this->getJson("/api/institutions/{$institution->uuid}/links")->assertUnauthorized();
$this->postJson("/api/institutions/{$institution->uuid}/links", $this->validPayload())->assertUnauthorized();
}
}