Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

Commit

Permalink
fix assets test
Browse files Browse the repository at this point in the history
  • Loading branch information
Demetriex committed Mar 10, 2021
1 parent 04da724 commit 7e4b82e
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions tests/Feature/AssetsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,24 @@

use App\Asset;
use App\User;
use Tests\TestCase;
use Tests\RefreshTestCase;

class AssetsTest extends TestCase
class AssetsTest extends RefreshTestCase
{
public const ASSET_DATA = [
'title' => 'My Own Asset',
'blurb' => 'One-line description of the asset',
'description' => 'A long description…',
'tags' => 'platformer, 2d, pixel-art, gdnative',
'category' => Asset::CATEGORY_2D_TOOLS,
'category_id' => Asset::CATEGORY_2D_TOOLS,
'license' => 'MIT',
'versions[0][version_string]' => '1.0.0',
'versions[0][godot_version]' => '3.2',
'cost' => 'MIT',
'versions' => [
0 => [
'version_string' => '1.0.0',
'godot_version' => '3.x.x',
],
],
'browse_url' => 'https://github.com/Calinou/godot-asset-library-laravel',
];

Expand Down Expand Up @@ -105,9 +110,11 @@ public function testAssetSubmitNotLoggedIn(): void
public function testAssetSubmitLoggedIn(): void
{
$user = User::factory()->create();
$this->assertDatabaseMissing('assets', ['author_id' => $user->id]);
$response = $this->actingAs($user)->post('/asset', self::ASSET_DATA);
$response->dumpSession();
$response->assertRedirect('/');
$response->assertRedirect();
$response->assertSessionHas('statusType', 'success');
$this->assertDatabaseHas('assets', ['author_id' => $user->id]);
}

public function testAssetEditNotLoggedIn(): void
Expand Down

0 comments on commit 7e4b82e

Please sign in to comment.