/** @test */ public function it_gets_all_statuses_for_a_user() { // Given $users = TestDummy::times(2)->create('Larabook\\Users\\User'); TestDummy::times(2)->create('Larabook\\Statuses\\Status', ['user_id' => $users[0]->id]); TestDummy::times(2)->create('Larabook\\Statuses\\Status', ['user_id' => $users[1]->id]); // When $statusesForUser = $this->repository->getAllForUser($users[0]->id); // Then $this->assertCount(2, $statusesForUser); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $statuses = $this->statusRepository->getAllForUser(Auth::user()); return View::make('statuses.index', compact('statuses')); }