diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-01-02 15:48:58 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-01-02 15:48:58 -0800 |
commit | bad83900ae07490975541902f157d7e16a8254d9 (patch) | |
tree | f8b4dc288870846859183ba0f305da8bf088d2aa /modules/gallery/tests | |
parent | 681613ac9e1fb21cab93033cf08b0e02b673e1b8 (diff) |
Fix two issues with change_album_test()
1) We do support changing the name.
2) Choose a random name to avoid conflicts.
Diffstat (limited to 'modules/gallery/tests')
-rw-r--r-- | modules/gallery/tests/Albums_Controller_Test.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/gallery/tests/Albums_Controller_Test.php b/modules/gallery/tests/Albums_Controller_Test.php index eec08868..4d8935cd 100644 --- a/modules/gallery/tests/Albums_Controller_Test.php +++ b/modules/gallery/tests/Albums_Controller_Test.php @@ -35,8 +35,10 @@ class Albums_Controller_Test extends Unit_Test_Case { $this->_album = album::create($root, "test", "test", "test"); $orig_name = $this->_album->name; - $_POST["dirname"] = "test"; - $_POST["name"] = "new name"; + // Randomize to avoid conflicts. + $new_dirname = "new_name_" . rand(); + + $_POST["dirname"] = $new_dirname; $_POST["title"] = "new title"; $_POST["description"] = "new description"; $_POST["column"] = "weight"; @@ -54,11 +56,9 @@ class Albums_Controller_Test extends Unit_Test_Case { $this->assert_equal( json_encode(array("result" => "success")), $results); + $this->assert_equal($new_dirname, $this->_album->name); $this->assert_equal("new title", $this->_album->title); $this->assert_equal("new description", $this->_album->description); - - // We don't change the name, yet. - $this->assert_equal($orig_name, $this->_album->name); } public function change_album_no_csrf_fails_test() { |