36 lines
1.0 KiB
PHP
36 lines
1.0 KiB
PHP
<?php
|
|
|
|
use App\Models\User;
|
|
|
|
it('can validate Update Workspace Select Option Job', function () {
|
|
$user = $this->actingAsUser();
|
|
$workspace = $this->createUserWorkspace($user);
|
|
$form = $this->createForm($user, $workspace);
|
|
$formData = $this->generateFormSubmissionData($form);
|
|
|
|
$this->postJson(route('forms.answer', $form->slug), $formData)
|
|
->assertSuccessful()
|
|
->assertJson([
|
|
'type' => 'success',
|
|
'message' => 'Form submission saved.',
|
|
]);
|
|
|
|
$formData = $this->generateFormSubmissionData($form);
|
|
$this->postJson(route('forms.answer', $form->slug), $formData)
|
|
->assertSuccessful()
|
|
->assertJson([
|
|
'type' => 'success',
|
|
'message' => 'Form submission saved.',
|
|
]);
|
|
});
|
|
|
|
it('can validate scope with active subscription', function () {
|
|
$this->createProUser();
|
|
$this->createUser();
|
|
$this->createProUser();
|
|
$this->createProUser();
|
|
$this->createUser();
|
|
|
|
expect(User::WithActiveSubscription()->count())->toBe(3);
|
|
});
|