adminUserSigningIn(); $payment = factory(Payment::class)->create(['owner_id' => $admin->id]); $unShownPayment = factory(Payment::class)->create(['owner_id' => $admin->id]); $this->visit(route('payments.index', ['customer_id' => $payment->customer_id])); $this->seePageIs(route('payments.index', ['customer_id' => $payment->customer_id])); $this->see($payment->project->name); $this->dontSee($unShownPayment->project->name); } }