feat: plan store/update respect back redirect
This commit is contained in:
@@ -91,6 +91,8 @@ class AdminPlanTest extends TestCase
|
||||
->assertSee('新建套餐')
|
||||
->assertSee('套餐名称');
|
||||
|
||||
$back = '/admin/plans?status=active&billing_cycle=monthly';
|
||||
|
||||
$this->post('/admin/plans', [
|
||||
'code' => 'pro_monthly_form',
|
||||
'name' => '专业版(月付)',
|
||||
@@ -101,7 +103,8 @@ class AdminPlanTest extends TestCase
|
||||
'sort' => 5,
|
||||
'description' => '主要面向成长型站点',
|
||||
'published_at' => now()->format('Y-m-d H:i:s'),
|
||||
])->assertRedirect('/admin/plans');
|
||||
'back' => $back,
|
||||
])->assertRedirect($back);
|
||||
|
||||
$this->get('/admin/plans')
|
||||
->assertSee('专业版(月付)')
|
||||
@@ -126,6 +129,8 @@ class AdminPlanTest extends TestCase
|
||||
->assertOk()
|
||||
->assertSee('编辑套餐');
|
||||
|
||||
$back = '/admin/plans?published=unpublished';
|
||||
|
||||
$this->post('/admin/plans/' . $plan->id, [
|
||||
'code' => 'update_test',
|
||||
'name' => '更新后套餐',
|
||||
@@ -135,7 +140,8 @@ class AdminPlanTest extends TestCase
|
||||
'status' => 'active',
|
||||
'sort' => 10,
|
||||
'description' => '通过编辑表单更新',
|
||||
])->assertRedirect('/admin/plans');
|
||||
'back' => $back,
|
||||
])->assertRedirect($back);
|
||||
|
||||
$this->get('/admin/plans')
|
||||
->assertSee('更新后套餐')
|
||||
|
||||
Reference in New Issue
Block a user