summaryrefslogtreecommitdiff
path: root/modules/gallery/tests/Item_Model_Test.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/tests/Item_Model_Test.php')
-rw-r--r--modules/gallery/tests/Item_Model_Test.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/modules/gallery/tests/Item_Model_Test.php b/modules/gallery/tests/Item_Model_Test.php
index d0676292..15aa2d8c 100644
--- a/modules/gallery/tests/Item_Model_Test.php
+++ b/modules/gallery/tests/Item_Model_Test.php
@@ -295,7 +295,6 @@ class Item_Model_Test extends Gallery_Unit_Test_Case {
} catch (ORM_Validation_Exception $e) {
$this->assert_same(array("description" => "length",
"name" => "required",
- "slug" => "required",
"title" => "required",
"album_cover_item_id" => "invalid_item",
"parent_id" => "invalid",
@@ -324,6 +323,12 @@ class Item_Model_Test extends Gallery_Unit_Test_Case {
$album->save();
}
+ public function name_with_only_invalid_chars_is_still_valid_test() {
+ $album = test::random_album_unsaved();
+ $album->name = "[]";
+ $album->save();
+ }
+
public function cant_change_item_type_test() {
$photo = test::random_photo();
try {
@@ -358,4 +363,12 @@ class Item_Model_Test extends Gallery_Unit_Test_Case {
$this->assert_true(!array_key_exists("parent_id", $result));
$this->assert_true(!array_key_exists("album_cover_item_id", $result));
}
+
+ public function first_photo_becomes_album_cover() {
+ $album = test::random_album();
+ $photo = test::random_photo($album);
+ $album->reload();
+
+ $this->assert_same($photo->id, $album->album_cover_item_id);
+ }
}