mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-19 04:14:04 +00:00
Add seeder and test for setting_credit
This commit is contained in:
@@ -16,5 +16,6 @@ class DatabaseSeeder extends Seeder
|
||||
$this->call(UserRoleSeeder::class);
|
||||
$this->call(RateTableSeeder::class);
|
||||
$this->call(BookTableSeeder::class);
|
||||
$this->call(SettingCreditSeeder::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\SettingCredit;
|
||||
|
||||
class SettingCreditSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
DB::table('setting_credits')->insert([
|
||||
'rmb_credit_limit' => '4000',
|
||||
'usd_credit_limit' => '5000',
|
||||
'time_limit' => '600'
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -24,10 +24,12 @@ class SettingCreditTest extends TestCase
|
||||
}
|
||||
|
||||
public function testStore(){
|
||||
|
||||
$this->actingAs($this->user)
|
||||
->postJson('/api/setting-credit/', [
|
||||
'rmb_credit_limit' => '5000',
|
||||
'usd_credit_limit' => '2000'
|
||||
'usd_credit_limit' => '2000',
|
||||
'time_limit' => '500'
|
||||
])
|
||||
->assertStatus(201);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user