mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fixes for tests
This commit is contained in:
parent
67a444ad2b
commit
8eb8f6e098
@ -22,10 +22,9 @@ class Subscription extends BaseModel
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'product_id',
|
||||
'product_ids',
|
||||
'recurring_product_ids',
|
||||
'company_id',
|
||||
'product_id',
|
||||
'is_recurring',
|
||||
'frequency_id',
|
||||
'auto_bill',
|
||||
'promo_code',
|
||||
@ -43,6 +42,7 @@ class Subscription extends BaseModel
|
||||
'refund_period',
|
||||
'webhook_configuration',
|
||||
'currency_id',
|
||||
'group_id',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
|
@ -21,10 +21,12 @@ class RefactorBillingScriptionsTable extends Migration
|
||||
$table->text('recurring_product_ids');
|
||||
$table->string('name');
|
||||
$table->unique(['company_id', 'name']);
|
||||
$table->unsignedInteger('group_id');
|
||||
});
|
||||
|
||||
Schema::table('subscriptions', function (Blueprint $table) {
|
||||
$table->renameColumn('product_id', 'product_ids');
|
||||
$table->dropColumn('is_recurring');
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ class SubscriptionApiTest extends TestCase
|
||||
]);
|
||||
|
||||
$billing_subscription = Subscription::factory()->create([
|
||||
'product_id' => $product->id,
|
||||
'product_ids' => $product->id,
|
||||
'company_id' => $this->company->id,
|
||||
]);
|
||||
|
||||
@ -78,7 +78,7 @@ class SubscriptionApiTest extends TestCase
|
||||
$response = $this->withHeaders([
|
||||
'X-API-SECRET' => config('ninja.api_secret'),
|
||||
'X-API-TOKEN' => $this->token,
|
||||
])->post('/api/v1/subscriptions', ['product_id' => $product->id, 'allow_cancellation' => true]);
|
||||
])->post('/api/v1/subscriptions', ['product_ids' => $product->id, 'allow_cancellation' => true]);
|
||||
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
@ -92,7 +92,7 @@ class SubscriptionApiTest extends TestCase
|
||||
|
||||
$response1 = $this
|
||||
->withHeaders(['X-API-SECRET' => config('ninja.api_secret'),'X-API-TOKEN' => $this->token])
|
||||
->post('/api/v1/subscriptions', ['product_id' => $product->id])
|
||||
->post('/api/v1/subscriptions', ['product_ids' => $product->id])
|
||||
->assertStatus(200)
|
||||
->json();
|
||||
|
||||
@ -123,7 +123,7 @@ class SubscriptionApiTest extends TestCase
|
||||
]);
|
||||
|
||||
$billing_subscription = Subscription::factory()->create([
|
||||
'product_id' => $product->id,
|
||||
'product_ids' => $product->id,
|
||||
'company_id' => $this->company->id,
|
||||
]);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user