add handle for exceed credit limit

This commit is contained in:
Too
2018-06-25 16:03:24 +08:00
parent efb5f21567
commit 9aea239c52
3 changed files with 250 additions and 233 deletions
+11 -2
View File
@@ -16,12 +16,14 @@ use App\User;
use App\Booking;
use App\UserBankSlip;
use App\Role;
use App\SettingCredit;
class BookingTest extends TestCase
{
protected $user;
protected $booking;
protected $userBankSlip;
protected $setting_credit;
public function setUp()
{
@@ -29,6 +31,7 @@ class BookingTest extends TestCase
Artisan::call('db:seed');
$this->user = factory(User::class)->create();
$this->setting_credit = factory(SettingCredit::class)->create();
$this->booking = factory(Booking::class)->create([
'user_id' => $this->user->id
]);
@@ -67,8 +70,14 @@ class BookingTest extends TestCase
'usd_book_cnap' => '2131rew',
'usd_book_bank_branch' => '2131rew',
'verification_status' => '1'
])
->assertStatus(201);
]);
if(14000 > $this->setting_credit->rmb_credit_limit){
$response->assertStatus(401);
}
else{
$response->assertStatus(201);
}
}
public function testuploadbankslip()