diff --git a/tests/Unit/ApiTest.php b/tests/Unit/ApiTest.php index 50c712d3..00f15843 100644 --- a/tests/Unit/ApiTest.php +++ b/tests/Unit/ApiTest.php @@ -2,7 +2,6 @@ namespace Tests\Unit; -use App\Category; use Tests\TestCase; use Illuminate\Foundation\Testing\WithFaker; use Illuminate\Foundation\Testing\RefreshDatabase; @@ -122,9 +121,9 @@ public function testApiInterface() public function testGetTeams() { - $user = factory(\App\User::class)->create(); - $teams = new ApiController(); - $teams->getTeams(); - $this->assertEquals('object', gettype($teams)); + factory(\App\Team::class)->create(); + $teamsController = new ApiController(); + $teams = $teamsController->getTeams(); + $this->assertEquals('array', gettype($teams)); } } diff --git a/tests/Unit/RedirectIfAuthenticatedTest.php b/tests/Unit/RedirectIfAuthenticatedTest.php new file mode 100644 index 00000000..7fdc6529 --- /dev/null +++ b/tests/Unit/RedirectIfAuthenticatedTest.php @@ -0,0 +1,25 @@ +get('/login'); + $response->assertStatus(200); + } + + public function testAuthenticated() + { + $user = factory(User::class)->create(); + $response = $this->actingAs($user)->get('/login'); + $response->assertRedirect('/home'); + } +}