Add application API keys
This commit is contained in:
@@ -24,7 +24,7 @@ class ProjectApiTest extends TestCase
|
||||
|
||||
$this->syncProjectPermissions($visibleProject, $user, ['view']);
|
||||
|
||||
$this->actingAs($user)
|
||||
$this->withApplicationKey($user)
|
||||
->getJson(route('api.projects.index'))
|
||||
->assertOk()
|
||||
->assertJsonPath('data.0.name', 'Visible project')
|
||||
@@ -36,7 +36,7 @@ class ProjectApiTest extends TestCase
|
||||
$user = User::factory()->create();
|
||||
$this->syncGlobalPermissions($user, ['create']);
|
||||
|
||||
$this->actingAs($user)
|
||||
$this->withApplicationKey($user)
|
||||
->postJson(route('api.projects.store'), [
|
||||
'key' => 'api',
|
||||
'name' => 'API Project',
|
||||
@@ -61,20 +61,20 @@ class ProjectApiTest extends TestCase
|
||||
|
||||
app(InitializeProjectTicketMetadata::class)->handle($project);
|
||||
|
||||
$this->actingAs($user)
|
||||
$this->withApplicationKey($user)
|
||||
->getJson(route('api.projects.show', $project))
|
||||
->assertForbidden();
|
||||
|
||||
$this->syncProjectPermissions($project, $user, ['view']);
|
||||
|
||||
$this->actingAs($user)
|
||||
$this->withApplicationKey($user)
|
||||
->getJson(route('api.projects.show', $project))
|
||||
->assertOk()
|
||||
->assertJsonPath('data.key', 'CORE');
|
||||
|
||||
$this->syncGlobalPermissions($admin, ['admin']);
|
||||
|
||||
$this->actingAs($admin)
|
||||
$this->withApplicationKey($admin)
|
||||
->deleteJson(route('api.projects.destroy', $project), [
|
||||
'confirmation_key' => 'CORE',
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user