Skip to content

Instantly share code, notes, and snippets.

@duncanmcclean
Created March 24, 2019 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save duncanmcclean/7722e6434a61c1cb4ecaffd09dc1e435 to your computer and use it in GitHub Desktop.
Save duncanmcclean/7722e6434a61c1cb4ecaffd09dc1e435 to your computer and use it in GitHub Desktop.
<?php
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
class LoginTest extends TestCase
{
use RefreshDatabase;
public function testLogin()
{
$user = factory(\App\User::class)->create();
$response = $this->post('/login', [
'email' => $user->email,
'password' => 'secret'
]);
$response->assertStatus(302)
->assertRedirect('/articles');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment