Created
June 12, 2019 10:30
-
-
Save bedus-creation/fcb61a55590fe75cf47b1829a93ea7f2 to your computer and use it in GitHub Desktop.
Test email queued in laravel application. This particular gist test the email is queued to jobseeker and company user when jobseeker applied to the jobs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function email_is_sent_when_job_applied() | |
{ | |
Mail::fake(); | |
$this->be(cUser('jobseeker')); | |
$data = $this->getData(); | |
$this->post('job/applyjobs', $data); | |
$company = User::find($data["company_id"]); | |
Mail::assertQueued(JobAppliedEmail::class, 2); | |
Mail::assertQueued(JobAppliedEmail::class, function ($email) { | |
return $email->to(auth()->user()->email); | |
}); | |
Mail::assertQueued(JobAppliedEmail::class, function ($email) use ($company) { | |
return $email->to($company->email); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment