<?php

namespace Tests\Feature;

use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
use App\User;
use App\Role;
use Artisan;

class MarkingTest extends TestCase
{
    protected $user;

    public function setUp()
    {
       	parent::setUp();
	
		\DB::statement('SET FOREIGN_KEY_CHECKS=0');
		Artisan::call('db:seed');
		\DB::statement('SET FOREIGN_KEY_CHECKS=1');

       	$this->user = factory(User::class)->create();
       	$this->user->attachRole(Role::Where('name','admin')->first());
    }

    public function testCreate(){
    	$response =
    	$this->actingAs($this->user)
    	  ->postJson('/api/setting-marking/',[
    	      'email' => 'user@example.com',
    	      'marking' => 'markingcode123'
    	  ])
		  ->assertStatus(201);
    }
}
