test that items capabilities are set properly

This commit is contained in:
Leo Germani 2018-03-01 20:41:01 -03:00
parent 03a78c3745
commit 97d2668078
1 changed files with 2 additions and 0 deletions

View File

@ -135,6 +135,8 @@ class Permissions extends TAINACAN_UnitTestCase {
// Once we had a bug that items of all collections shared the same capability type. they should not.
// This test avoid it to happen
$this->assertNotEquals($item2->get_capabilities()->edit_posts, $item->get_capabilities()->edit_posts);
$this->assertTrue(current_user_can( $item2->get_capabilities()->edit_post, $item2->get_id() ), 'author should be able to edit items in his collection');
$this->assertFalse(current_user_can( $item->get_capabilities()->edit_post, $item->get_id() ), 'author should not be able to edit items in admins collection');