Add seeder and test for setting_credit

This commit is contained in:
Too
2018-06-26 11:47:48 +08:00
parent 3129da5df4
commit f31f39caec
3 changed files with 25 additions and 1 deletions
+1
View File
@@ -16,5 +16,6 @@ class DatabaseSeeder extends Seeder
$this->call(UserRoleSeeder::class);
$this->call(RateTableSeeder::class);
$this->call(BookTableSeeder::class);
$this->call(SettingCreditSeeder::class);
}
}
+21
View File
@@ -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'
]);
}
}
+3 -1
View File
@@ -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);
}