summaryrefslogtreecommitdiff
path: root/modules/gallery/tests
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/tests')
-rw-r--r--modules/gallery/tests/Gallery_Rest_Helper_Test.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/modules/gallery/tests/Gallery_Rest_Helper_Test.php b/modules/gallery/tests/Gallery_Rest_Helper_Test.php
index 9c960409..dae55952 100644
--- a/modules/gallery/tests/Gallery_Rest_Helper_Test.php
+++ b/modules/gallery/tests/Gallery_Rest_Helper_Test.php
@@ -181,4 +181,26 @@ class Gallery_Rest_Helper_Test extends Unit_Test_Case {
$this->assert_equal("Updated Title", $this->_photo->title);
$this->assert_equal("new name", $this->_photo->name);
}
+
+ public function gallery_rest_delete_album_test() {
+ access::allow(identity::registered_users(), "edit", $this->_album);
+
+ identity::set_active_user($this->_user);
+ $request = (object)array("path" => $this->_child->relative_url());
+
+ $this->assert_equal(json_encode(array("status" => "OK")), gallery_rest::delete($request));
+ $this->_child->reload();
+ $this->assert_false($this->_child->loaded);
+ }
+
+ public function gallery_rest_delete_photo_test() {
+ access::allow(identity::registered_users(), "edit", $this->_album);
+
+ identity::set_active_user($this->_user);
+ $request = (object)array("path" => $this->_sibling->relative_url());
+
+ $this->assert_equal(json_encode(array("status" => "OK")), gallery_rest::delete($request));
+ $this->_sibling->reload();
+ $this->assert_false($this->_sibling->loaded);
+ }
}