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:
56
tests/Feature/IntroductionsTest.php
Normal file
56
tests/Feature/IntroductionsTest.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Tests\FeatureTestCase;
|
||||
use App\Models\Contact\Contact;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
|
||||
class IntroductionsTest extends FeatureTestCase
|
||||
{
|
||||
use DatabaseTransactions;
|
||||
|
||||
public function test_it_display_introductions_screen()
|
||||
{
|
||||
$user = $this->signin();
|
||||
|
||||
$contact = factory(Contact::class)->create([
|
||||
'account_id' => $user->account_id,
|
||||
]);
|
||||
|
||||
$response = $this->get("/people/{$contact->hashID()}/introductions/edit");
|
||||
|
||||
$response->assertStatus(200);
|
||||
$response->assertSee("How did you meet {$contact->first_name}");
|
||||
}
|
||||
|
||||
public function test_it_update_introductions()
|
||||
{
|
||||
$user = $this->signin();
|
||||
|
||||
$contact = factory(Contact::class)->create([
|
||||
'account_id' => $user->account_id,
|
||||
]);
|
||||
|
||||
$response = $this->post("/people/{$contact->hashID()}/introductions/update", [
|
||||
'first_met_additional_info' => 'info',
|
||||
'is_first_met_date_known' => 'known',
|
||||
'first_met_year' => 2006,
|
||||
'first_met_month' => 1,
|
||||
'first_met_day' => 2,
|
||||
'addReminder' => 'on',
|
||||
]);
|
||||
|
||||
$response->assertStatus(302);
|
||||
$response->assertRedirect("/people/{$contact->hashID()}");
|
||||
|
||||
$this->assertDatabaseHas('special_dates', [
|
||||
'account_id' => $user->account_id,
|
||||
'contact_id' => $contact->id,
|
||||
'id' => Contact::find($contact->id)->first_met_special_date_id,
|
||||
'is_age_based' => false,
|
||||
'is_year_unknown' => false,
|
||||
'date' => '2006-01-02',
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user