From 14b0ab08b4cab5b78bca3d5f63eb0f34cf788494 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 2 Jan 2010 13:53:01 -0800 Subject: Update the expected response after modifying an album to match the change I made in 20bd09ff004816ae152a2f890a24dc5e85741fac --- modules/gallery/tests/Albums_Controller_Test.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'modules/gallery/tests/Albums_Controller_Test.php') diff --git a/modules/gallery/tests/Albums_Controller_Test.php b/modules/gallery/tests/Albums_Controller_Test.php index 5f23f821..eec08868 100644 --- a/modules/gallery/tests/Albums_Controller_Test.php +++ b/modules/gallery/tests/Albums_Controller_Test.php @@ -20,7 +20,6 @@ class Albums_Controller_Test extends Unit_Test_Case { public function setup() { $this->_save = array($_POST, $_SERVER); - $_SERVER["HTTP_REFERER"] = "HTTP_REFERER"; } public function teardown() { @@ -53,7 +52,7 @@ class Albums_Controller_Test extends Unit_Test_Case { ob_end_clean(); $this->assert_equal( - json_encode(array("result" => "success", "location" => "HTTP_REFERER")), + json_encode(array("result" => "success")), $results); $this->assert_equal("new title", $this->_album->title); $this->assert_equal("new description", $this->_album->description); -- cgit v1.2.3 From bad83900ae07490975541902f157d7e16a8254d9 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 2 Jan 2010 15:48:58 -0800 Subject: Fix two issues with change_album_test() 1) We do support changing the name. 2) Choose a random name to avoid conflicts. --- modules/gallery/tests/Albums_Controller_Test.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'modules/gallery/tests/Albums_Controller_Test.php') 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() { -- cgit v1.2.3