refactor: replace custom CRM with Monica fork
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
This commit is contained in:
32
tests/Unit/Jobs/UpdateLastConsultedDateTest.php
Normal file
32
tests/Unit/Jobs/UpdateLastConsultedDateTest.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit\Jobs;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Tests\TestCase;
|
||||
use App\Models\Contact\Contact;
|
||||
use App\Jobs\UpdateLastConsultedDate;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
|
||||
class UpdateLastConsultedDateTest extends TestCase
|
||||
{
|
||||
use DatabaseTransactions;
|
||||
|
||||
/** @test */
|
||||
public function it_updates_the_last_consulted_at_field_for_the_given_contact()
|
||||
{
|
||||
Carbon::setTestNow(Carbon::create(2017, 1, 1, 7, 0, 0));
|
||||
|
||||
$contact = factory(Contact::class)->create([
|
||||
'number_of_views' => 1,
|
||||
]);
|
||||
|
||||
UpdateLastConsultedDate::dispatch($contact);
|
||||
|
||||
$this->assertDatabaseHas('contacts', [
|
||||
'id' => $contact->id,
|
||||
'last_consulted_at' => '2017-01-01 07:00:00',
|
||||
'number_of_views' => 2,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user