summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-09-10 23:12:38 -0400
committerFrederic Guillot <fred@kanboard.net>2016-09-10 23:12:38 -0400
commita0227cad69aff9486fba1d7b2a19e6da97450100 (patch)
treee4585be087759022b8a3d0108eacff3494da470e /tests
parent44f680cf2f1463721eb5bdb7eda4d3b339e63ba9 (diff)
Define only what is allowed for column restrictions
Diffstat (limited to 'tests')
-rw-r--r--tests/units/Helper/BoardHelperTest.php4
-rw-r--r--tests/units/Model/ColumnMoveRestrictionModelTest.php5
2 files changed, 6 insertions, 3 deletions
diff --git a/tests/units/Helper/BoardHelperTest.php b/tests/units/Helper/BoardHelperTest.php
index 641ca9cb..0a44f8ab 100644
--- a/tests/units/Helper/BoardHelperTest.php
+++ b/tests/units/Helper/BoardHelperTest.php
@@ -87,8 +87,12 @@ class BoardHelperTest extends Base
$this->assertTrue($projectUserRole->addUser(1, 2, 'Custom Role'));
$this->assertEquals(1, $taskCreationModel->create(array('project_id' => 1, 'title' => 'test', 'column_id' => 2)));
+ $this->assertEquals(2, $taskCreationModel->create(array('project_id' => 1, 'title' => 'test', 'column_id' => 3)));
$task = $taskFinderModel->getById(1);
+ $this->assertTrue($boardHelper->isDraggable($task));
+
+ $task = $taskFinderModel->getById(2);
$this->assertFalse($boardHelper->isDraggable($task));
}
}
diff --git a/tests/units/Model/ColumnMoveRestrictionModelTest.php b/tests/units/Model/ColumnMoveRestrictionModelTest.php
index 3bef6f99..c0ed18ac 100644
--- a/tests/units/Model/ColumnMoveRestrictionModelTest.php
+++ b/tests/units/Model/ColumnMoveRestrictionModelTest.php
@@ -132,8 +132,7 @@ class ColumnMoveRestrictionModelTest extends Base
$this->assertEquals(1, $columnMoveRestrictionModel->create(1, 1, 2, 3));
$this->assertEquals(2, $columnMoveRestrictionModel->create(1, 2, 3, 4));
- $this->assertTrue($columnMoveRestrictionModel->isAllowed(1, 'Role D', 1, 2));
- $this->assertTrue($columnMoveRestrictionModel->isAllowed(1, 'Role A', 1, 2));
- $this->assertFalse($columnMoveRestrictionModel->isAllowed(1, 'Role A', 2, 3));
+ $this->assertFalse($columnMoveRestrictionModel->isAllowed(1, 'Role A', 1, 2));
+ $this->assertTrue($columnMoveRestrictionModel->isAllowed(1, 'Role A', 2, 3));
}
}