Skip to content

Commit

Permalink
Allow users to bulk-submit links, lists and tags (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kovah committed Sep 23, 2024
1 parent 9961afd commit a386532
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/Controller/API/BulkStoreApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@ class BulkStoreApiTest extends TestCase
{
use RefreshDatabase;

private User $user;

protected function setUp(): void
{
parent::setUp();

$this->user = User::factory()->create();
$this->actingAs($this->user);

Queue::fake();
}

Expand All @@ -30,7 +36,7 @@ public function testStoreLinks(): void
'duckduckgo.com' => Http::response($testHtml),
]);

$response = $this->post('api/v2/bulk/links', [
$response = $this->postJson('api/v2/bulk/links', [
'models' => [
[
'url' => 'https://example.com',
Expand Down Expand Up @@ -72,7 +78,7 @@ public function testStoreLinks(): void

public function testStoreLists(): void
{
$response = $this->post('api/v2/bulk/lists', [
$response = $this->postJson('api/v2/bulk/lists', [
'models' => [
[
'name' => 'Example List',
Expand Down Expand Up @@ -108,7 +114,7 @@ public function testStoreLists(): void

public function testStoreTags(): void
{
$response = $this->post('api/v2/bulk/tags', [
$response = $this->postJson('api/v2/bulk/tags', [
'models' => [
[
'name' => 'tag-a',
Expand Down

0 comments on commit a386532

Please sign in to comment.