added it_get_user_invoices test

This commit is contained in:
Peter Papp
2021-03-04 14:15:07 +01:00
parent 7e4bd191d7
commit d4df26bf35
5 changed files with 121 additions and 100 deletions

View File

@@ -168,9 +168,9 @@ class SubscriptionTest extends TestCase
}
/**
* @test
*
*/
public function it_get_user_subscription()
public function it_get_user_subscription_details()
{
$user = User::factory(User::class)
->create($this->user);
@@ -206,4 +206,29 @@ class SubscriptionTest extends TestCase
]
]);
}
/**
* @test
*/
public function it_get_user_invoices()
{
$user = User::factory(User::class)
->create($this->user);
Sanctum::actingAs($user);
$this->postJson('/api/user/subscription/upgrade', [
'billing' => $this->billing,
'plan' => $this->plan,
'payment' => [
'type' => 'stripe',
],
])->assertStatus(204);
$this->getJson('/api/user/invoices')
->assertStatus(200)
->assertJsonFragment([
'customer' => $this->user['stripe_id']
]);
}
}