Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
temaotl committed Jul 15, 2024
1 parent dd1446f commit 7d13e99
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 1 deletion.
4 changes: 4 additions & 0 deletions tests/Feature/Http/Controllers/CategoryControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Tests\Feature\Http\Controllers;

use App\Jobs\EduGainAddEntity;
use App\Jobs\GitAddCategory;
use App\Jobs\GitDeleteCategory;
use App\Jobs\GitUpdateCategory;
Expand All @@ -10,6 +11,7 @@
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Support\Facades\Queue;
use Illuminate\Support\Facades\Bus;
use Tests\TestCase;

Expand Down Expand Up @@ -430,6 +432,7 @@ public function an_admin_can_delete_an_existing_category_without_members()
/** @test */
public function an_admin_cannot_delete_an_existing_category_with_members()
{
Queue::fake();
$admin = User::factory()->create(['admin' => true]);
$category = Category::factory()->create();
$category->entities()->save(Entity::factory()->create());
Expand All @@ -448,5 +451,6 @@ public function an_admin_cannot_delete_an_existing_category_with_members()
$this->assertEquals(1, $category->entities()->count());
$this->assertEquals(1, Entity::count());
$this->assertEquals(route('categories.show', $category), url()->current());
Queue::assertPushed(EduGainAddEntity::class);
}
}
Loading

0 comments on commit 7d13e99

Please sign in to comment.