product photos controller test fixes, test out
This commit is contained in:
@@ -273,17 +273,19 @@ class ProductPhotosControllerTest extends BaseControllerTest
|
||||
$id,
|
||||
];
|
||||
$data = [
|
||||
// test new data here
|
||||
'enabled' => 1,
|
||||
'primary_photo' => 1,
|
||||
'photo_position' => 999,
|
||||
];
|
||||
// $this->put($url, $data);
|
||||
$this->put($url, $data);
|
||||
|
||||
$this->assertResponseCode(302);
|
||||
$this->assertRedirectContains('product-photos');
|
||||
|
||||
$after = $this->ProductPhotos->get($id);
|
||||
$this->assertEquals($data['photo_position'], $after->photo_position);
|
||||
$this->assertTrue($after->primary_photo);
|
||||
$this->assertTrue($after->enabled);
|
||||
// assert saved properly below
|
||||
}
|
||||
|
||||
@@ -308,10 +310,16 @@ class ProductPhotosControllerTest extends BaseControllerTest
|
||||
'action' => 'edit',
|
||||
$id,
|
||||
];
|
||||
$data = [];
|
||||
$data = [
|
||||
'enabled' => 1,
|
||||
'primary_photo' => 1,
|
||||
'photo_position' => 'not-valid',
|
||||
];
|
||||
$this->put($url, $data);
|
||||
$this->assertResponseCode(200);
|
||||
$after = $this->ProductPhotos->get($id);
|
||||
$this->assertEquals($before->modified, $after->modified);
|
||||
$this->assertEquals($before->photo_position, $after->photo_position);
|
||||
|
||||
// assert save failed below
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user