<?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)
			->putJson('/api/setting-credit/',  [
			'rmb_credit_limit' => '5000',
			'usd_credit_limit' => '2000',
            'time_limit' => '500'
		])
		->assertStatus(200);
    }

}
