Check marking before create user

This commit is contained in:
Too
2018-06-20 15:43:04 +08:00
parent b1843c0b9b
commit a2dad37758
3 changed files with 31 additions and 1 deletions
+15 -1
View File
@@ -3,17 +3,31 @@
namespace Tests\Feature;
use Tests\TestCase;
use App\Marking;
use Artisan;
class RegisterTest extends TestCase
{
protected $marking;
public function setUp(){
parent::setUp();
Artisan::call('db:seed');
$this->marking = factory(Marking::class)->create();
}
/** @test */
public function can_register()
{
$response =
$this->postJson('/api/register', [
'name' => 'Test User',
'email' => 'test@test.app',
'email' => $this->marking->email,
'password' => 'secret',
'password_confirmation' => 'secret',
'marking' => $this->marking->marking
])
->assertSuccessful()
->assertJsonStructure(['id', 'name', 'email']);