Add integration test for remaining application api user endpoints
This commit is contained in:
parent
bbbab4bf81
commit
e8ea218f20
6 changed files with 355 additions and 20 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Tests\Traits;
|
||||
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Foundation\Testing\TestResponse;
|
||||
|
||||
trait IntegrationJsonRequestAssertions
|
||||
|
@ -13,7 +14,7 @@ trait IntegrationJsonRequestAssertions
|
|||
*/
|
||||
public function assertNotFoundJson(TestResponse $response)
|
||||
{
|
||||
$response->assertStatus(404);
|
||||
$response->assertStatus(Response::HTTP_NOT_FOUND);
|
||||
$response->assertJsonStructure(['errors' => [['code', 'status', 'detail']]]);
|
||||
$response->assertJsonCount(1, 'errors');
|
||||
$response->assertJson([
|
||||
|
@ -34,7 +35,7 @@ trait IntegrationJsonRequestAssertions
|
|||
*/
|
||||
public function assertAccessDeniedJson(TestResponse $response)
|
||||
{
|
||||
$response->assertStatus(403);
|
||||
$response->assertStatus(Response::HTTP_FORBIDDEN);
|
||||
$response->assertJsonStructure(['errors' => [['code', 'status', 'detail']]]);
|
||||
$response->assertJsonCount(1, 'errors');
|
||||
$response->assertJson([
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue