Files
monica/tests/Unit/InstanceTest.php
T
Régis FreydandGitHub 29197090a7 Restructure where models are stored (#1476)
The idea is to clean the repository a little bit by moving models into their respective folders.
2018-06-14 20:49:12 -04:00

28 lines
648 B
PHP

<?php
namespace Tests\Unit;
use Tests\TestCase;
use App\Jobs\AddChangelogEntry;
use App\Models\Account\Account;
use App\Models\Instance\Instance;
use Illuminate\Support\Facades\Bus;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class InstanceTest extends TestCase
{
use DatabaseTransactions;
public function test_it_creates_jobs_for_adding_a_unread_changelog_entry()
{
Bus::fake();
$instance = factory(Instance::class)->create([]);
$account = factory(Account::class, 3)->create([]);
$instance->addUnreadChangelogEntry(1);
Bus::assertDispatched(AddChangelogEntry::class);
}
}