Merge pull request 'Add application API keys' (#55) from codex/application-api-keys into main
Reviewed-on: OpenSource/KanbanGit#55
This commit was merged in pull request #55.
This commit is contained in:
@@ -28,7 +28,7 @@ class TicketApiTest extends TestCase
|
||||
$status = $project->ticketStatuses()->firstOrFail();
|
||||
$type = $project->ticketTypes()->where('is_parent', false)->firstOrFail();
|
||||
|
||||
$this->actingAs($user)
|
||||
$this->withApplicationKey($user)
|
||||
->getJson(route('api.projects.ticket-options', [
|
||||
'project' => $project,
|
||||
'source' => 'backlog',
|
||||
@@ -37,7 +37,7 @@ class TicketApiTest extends TestCase
|
||||
->assertJsonPath('data.defaultTicketStatusId', $status->id)
|
||||
->assertJsonPath('data.ticketTypes.0.id', $type->id);
|
||||
|
||||
$createResponse = $this->actingAs($user)
|
||||
$createResponse = $this->withApplicationKey($user)
|
||||
->postJson(route('api.projects.tickets.store', $project), [
|
||||
'acceptance_criteria' => 'Can sign in',
|
||||
'description' => 'Build the API-created ticket',
|
||||
@@ -53,12 +53,12 @@ class TicketApiTest extends TestCase
|
||||
|
||||
$ticket = Ticket::query()->findOrFail($createResponse->json('data.id'));
|
||||
|
||||
$this->actingAs($user)
|
||||
$this->withApplicationKey($user)
|
||||
->getJson(route('api.projects.tickets.index', $project))
|
||||
->assertOk()
|
||||
->assertJsonPath('data.0.ticket_key', 'CORE-1');
|
||||
|
||||
$this->actingAs($user)
|
||||
$this->withApplicationKey($user)
|
||||
->patchJson(route('api.projects.tickets.update', [$project, $ticket]), [
|
||||
'acceptance_criteria' => 'Can sign in from the API',
|
||||
'blocked_comment' => null,
|
||||
@@ -74,7 +74,7 @@ class TicketApiTest extends TestCase
|
||||
->assertJsonPath('data.title', 'Updated API ticket')
|
||||
->assertJsonPath('meta.message', 'CORE-1 was updated.');
|
||||
|
||||
$this->actingAs($user)
|
||||
$this->withApplicationKey($user)
|
||||
->getJson(route('api.projects.tickets.show', [$project, $ticket]))
|
||||
->assertOk()
|
||||
->assertJsonPath('data.ticket.ticket_key', 'CORE-1')
|
||||
@@ -172,13 +172,13 @@ class TicketApiTest extends TestCase
|
||||
|
||||
$ticket = $this->ticket($project, $backlogStatus);
|
||||
|
||||
$this->actingAs($user)
|
||||
$this->withApplicationKey($user)
|
||||
->getJson(route('api.projects.tickets.status-targets', [$project, $ticket]))
|
||||
->assertOk()
|
||||
->assertJsonPath('data.current_status.id', $backlogStatus->id)
|
||||
->assertJsonPath('data.target_statuses.0.id', $doingStatus->id);
|
||||
|
||||
$this->actingAs($user)
|
||||
$this->withApplicationKey($user)
|
||||
->patchJson(route('api.projects.tickets.status.update', [$project, $ticket]), [
|
||||
'ticket_status_id' => $doingStatus->id,
|
||||
])
|
||||
@@ -228,7 +228,7 @@ class TicketApiTest extends TestCase
|
||||
'position' => 1,
|
||||
]);
|
||||
|
||||
$this->actingAs($user)
|
||||
$this->withApplicationKey($user)
|
||||
->postJson(route('api.projects.tickets.links.store', [$project, $ticket]), [
|
||||
'linked_ticket_id' => $linkedTicket->id,
|
||||
'ticket_link_type_id' => $linkType->id,
|
||||
@@ -252,7 +252,7 @@ class TicketApiTest extends TestCase
|
||||
'provider' => GitProviderKey::Gitea,
|
||||
]);
|
||||
|
||||
$this->actingAs($user)
|
||||
$this->withApplicationKey($user)
|
||||
->getJson(route('api.projects.tickets.branches.validate', [
|
||||
'project' => $project,
|
||||
'ticket' => $ticket,
|
||||
@@ -262,7 +262,7 @@ class TicketApiTest extends TestCase
|
||||
->assertOk()
|
||||
->assertJsonPath('data.is_valid', true);
|
||||
|
||||
$this->actingAs($user)
|
||||
$this->withApplicationKey($user)
|
||||
->postJson(route('api.projects.tickets.branches.store', [$project, $ticket]), [
|
||||
'branch_name' => 'core-1-api-ticket',
|
||||
'repository_connection_id' => $repositoryConnection->id,
|
||||
@@ -290,12 +290,12 @@ class TicketApiTest extends TestCase
|
||||
'position' => 1,
|
||||
]);
|
||||
|
||||
$this->actingAs($user)
|
||||
$this->withApplicationKey($user)
|
||||
->getJson(route('api.projects.backlog', $project))
|
||||
->assertOk()
|
||||
->assertJsonPath('data.tickets.0.id', $ticket->id);
|
||||
|
||||
$this->actingAs($user)
|
||||
$this->withApplicationKey($user)
|
||||
->getJson(route('api.projects.board', $project))
|
||||
->assertOk()
|
||||
->assertJsonPath('data.boardColumns.0.name', 'Todo');
|
||||
|
||||
Reference in New Issue
Block a user