summaryrefslogtreecommitdiff
path: root/modules/gallery
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery')
-rw-r--r--modules/gallery/tests/Item_Model_Test.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/gallery/tests/Item_Model_Test.php b/modules/gallery/tests/Item_Model_Test.php
index 5294836d..afb131fc 100644
--- a/modules/gallery/tests/Item_Model_Test.php
+++ b/modules/gallery/tests/Item_Model_Test.php
@@ -318,4 +318,20 @@ class Item_Model_Test extends Unit_Test_Case {
$this->assert_false(true, "Shouldn't get here");
}
+
+ public function slug_is_url_safe_test() {
+ $album = test::random_album_unsaved();
+
+ try {
+ $album->slug = "illegal chars! !@#@#$!@~";
+ $album->save();
+ $this->assert_true(false, "Shouldn't be able to save");
+ } catch (ORM_Validation_Exception $e) {
+ $this->assert_same(array("slug" => "not_url_safe"), $e->validation->errors());
+ }
+
+ // This should work
+ $album->slug = "the_quick_brown_fox";
+ $album->save();
+ }
}