Skip to content

Commit

Permalink
improve test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
fokosun committed Aug 23, 2023
1 parent 22252df commit 5c02beb
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions tests/Feature/OtpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,23 @@ public function it_can_generate_otp_fails()
{
$randStr = Str::random(10);

$this
->json('POST', '/api/v1/otp/generate', [
'identifier' => $randStr
])
->assertExactJson([
"message" => "There was an error processing this request. Please try again."
]);

Log::shouldReceive('debug')
->once()
->with(
'Error sending OTP email',
[
'identifier' => $randStr,
'errorMsg' => 'zazu'
'errorMsg' => 'Email "' . $randStr . '" does not comply with addr-spec of RFC 2822.'
]
);

$this->withoutExceptionHandling()
->json('POST', '/api/v1/otp/generate', [
'identifier' => $randStr
])
->assertExactJson([
"message" => "There was an error processing this request. Please try again."
]);
}

/**
Expand Down

0 comments on commit 5c02beb

Please sign in to comment.