Skip to content

Commit

Permalink
Fixed tests that weren't using the json request methods
Browse files Browse the repository at this point in the history
  • Loading branch information
zakhenry committed Aug 27, 2015
1 parent ebc4ae0 commit a860b8b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions api/tests/integration/ImageTest.php
Expand Up @@ -41,7 +41,7 @@ public function testGetAllPaginated()
{
$entities = factory(Image::class, 30)->create()->all();

$this->get('/images', ['Range'=>'entities=0-19']);
$this->getJson('/images', ['Range'=>'entities=0-19']);
$this->assertResponseStatus(206);
$this->shouldReturnJson();
$this->assertJsonArray();
Expand All @@ -54,7 +54,7 @@ public function testGetOne()
{
$entity = factory(Image::class)->create();

$this->get('/images/'.$entity->image_id);
$this->getJson('/images/'.$entity->image_id);

$this->assertResponseOk();
$this->shouldReturnJson();
Expand Down Expand Up @@ -85,7 +85,7 @@ public function testPutOneNew()

$rowCount = Image::count();

$this->put('/images/'.$id, $this->prepareEntity($entity));
$this->putJson('/images/'.$id, $this->prepareEntity($entity));
$this->shouldReturnJson();
$object = json_decode($this->response->getContent());

Expand All @@ -102,7 +102,7 @@ public function testPatchOne()
$id = $entity->image_id;
$entity->alt = 'foo';
$preparedEntity = $this->prepareEntity($entity);
$this->patch('/images/'.$id, $preparedEntity);
$this->patchJson('/images/'.$id, $preparedEntity);
$this->shouldReturnJson();
$this->assertResponseStatus(204);
$checkEntity = Image::find($id);
Expand All @@ -117,7 +117,7 @@ public function testDeleteOne()
$entity = $entities[0];
$id = $entity->image_id;
$rowCount = Image::count();
$this->delete('/images/'.$id);
$this->deleteJson('/images/'.$id);
$this->assertResponseStatus(204);
$this->assertResponseHasNoContent();
$this->assertEquals($rowCount - 1, Image::count());
Expand Down

0 comments on commit a860b8b

Please sign in to comment.