added it_store_stripe_plans_via_setup_wizard test

This commit is contained in:
Peter Papp
2021-03-06 11:32:18 +01:00
parent 355b016f22
commit 88540bd2a6
5 changed files with 1908 additions and 1792 deletions

View File

@@ -14,6 +14,14 @@ class SetupWizardTest extends TestCase
{
use DatabaseMigrations;
/**
* CAVEAT:
*
* The route '/api/setup/stripe-plans' which is part of setup wizard is moved to
* SubscriptionTest.php to group all live API test. For more info how to test
* subscription integration in VueFileManager platform visit https://laravel.com/docs/8.x/billing#testing
*/
/**
* @test
*/

View File

@@ -5,6 +5,7 @@ namespace Tests\Feature;
use App\Models\User;
use Carbon\Carbon;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Support\Str;
use Laravel\Sanctum\Sanctum;
use Tests\TestCase;
@@ -293,4 +294,33 @@ class SubscriptionTest extends TestCase
'customer' => $this->user['stripe_id']
]);
}
/**
*
*/
public function it_store_stripe_plans_via_setup_wizard()
{
$this->postJson('/api/setup/stripe-plans', [
'plans' => [
[
'type' => 'plan',
'attributes' => [
'name' => 'test-plan-' . Str::random(16),
'price' => (string) rand(1, 99),
'description' => 'Some random description',
'capacity' => rand(1, 999),
],
],
[
'type' => 'plan',
'attributes' => [
'name' => 'test-plan-' . Str::random(16),
'price' => (string) rand(1, 99),
'description' => 'Some random description',
'capacity' => rand(1, 999),
],
],
]
])->assertStatus(204);
}
}