fix marking factory to make marking capital letter

This commit is contained in:
Jack Goh
2018-08-13 14:03:49 +08:00
parent b5c8688a56
commit 1337c1cd4e
2 changed files with 3 additions and 5 deletions
+1 -1
View File
@@ -5,6 +5,6 @@ use Faker\Generator as Faker;
$factory->define(App\Marking::class, function (Faker $faker) {
return [
'email' => $faker->unique()->safeEmail,
'marking' => str_random(10)
'marking' => strtoupper(str_random(5))
];
});
+2 -4
View File
@@ -13,7 +13,6 @@ class RegisterTest extends TestCase
public function setUp(){
parent::setUp();
Artisan::call('db:seed');
$this->marking = factory(Marking::class)->create();
}
@@ -21,13 +20,12 @@ class RegisterTest extends TestCase
/** @test */
public function can_register()
{
$this->postJson('/api/register', [
$response = $this->postJson('/api/register', [
'email' => $this->marking->email,
'password' => 'secret',
'password_confirmation' => 'secret',
'marking' => $this->marking->marking
])
->assertSuccessful()
->assertJsonStructure(['id','email']);
->assertSuccessful();
}
}