feat: revenue cat
This commit is contained in:
@@ -27,7 +27,9 @@ function fakeMealAnalysisImage(): UploadedFile
|
||||
|
||||
it('analyzes a meal image into a draft', function () {
|
||||
$user = User::factory()->create([
|
||||
'trial_ends_at' => now()->addDay(),
|
||||
'subscription_expires_at' => now()->addDay(),
|
||||
'subscription_is_trial' => true,
|
||||
'subscription_product_id' => 'monthly',
|
||||
]);
|
||||
|
||||
Sanctum::actingAs($user);
|
||||
@@ -113,7 +115,9 @@ it('analyzes a meal image into a draft', function () {
|
||||
|
||||
it('records a failed meal image analysis attempt', function () {
|
||||
$user = User::factory()->create([
|
||||
'trial_ends_at' => now()->addDay(),
|
||||
'subscription_expires_at' => now()->addDay(),
|
||||
'subscription_is_trial' => true,
|
||||
'subscription_product_id' => 'monthly',
|
||||
]);
|
||||
|
||||
Sanctum::actingAs($user);
|
||||
@@ -147,9 +151,11 @@ it('records a failed meal image analysis attempt', function () {
|
||||
|
||||
});
|
||||
|
||||
it('requires a trial or subscription to analyze a meal image', function () {
|
||||
it('requires an active subscription to analyze a meal image', function () {
|
||||
$user = User::factory()->create([
|
||||
'trial_ends_at' => now()->subDay(),
|
||||
'subscription_expires_at' => now()->subDay(),
|
||||
'subscription_is_trial' => true,
|
||||
'subscription_product_id' => 'monthly',
|
||||
]);
|
||||
|
||||
Sanctum::actingAs($user);
|
||||
@@ -182,7 +188,9 @@ it('requires authentication to analyze a meal image', function () {
|
||||
|
||||
it('validates the analyzed image', function () {
|
||||
Sanctum::actingAs(User::factory()->create([
|
||||
'trial_ends_at' => now()->addDay(),
|
||||
'subscription_expires_at' => now()->addDay(),
|
||||
'subscription_is_trial' => true,
|
||||
'subscription_product_id' => 'monthly',
|
||||
]));
|
||||
|
||||
$this
|
||||
|
||||
Reference in New Issue
Block a user