Add test for settingcredit and rate

This commit is contained in:
Too
2018-06-19 18:56:31 +08:00
parent 1b39ee8bda
commit 95f4f25dd3
6 changed files with 124 additions and 18 deletions
+35
View File
@@ -0,0 +1,35 @@
<?php
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
use App\User;
use App\SettingCredit;
use App\Role;
use Artisan;
class SettingCreditTest extends TestCase
{
protected $user;
public function setUp()
{
parent::setUp();
Artisan::call('db:seed');
$this->user = factory(User::class)->create();
$this->user->attachRole(Role::Where('name','admin')->first());
}
public function testStore(){
$this->actingAs($this->user)
->postJson('/api/setting-credit/', [
'rmb_credit_limit' => '5000',
'usd_credit_limit' => '2000'
])
->assertStatus(201);
}
}