favorites testing and tweak

This commit is contained in:
Shish 2009-07-28 11:45:21 +01:00
parent 77368cb03b
commit 5f106b0950
2 changed files with 29 additions and 1 deletions

View File

@ -0,0 +1,28 @@
<?php
class FavoritesTest extends ShimmieWebTestCase {
function testFavorites() {
$this->log_in_as_user();
$image_id = $this->post_image("ext/simpletest/data/pbx_screenshot.jpg", "test");
$this->get_page("post/view/$image_id");
$this->assertTitle("Image $image_id: test");
$this->assertNoText("Favorited By");
$this->click("Favorite");
$this->assertText("Favorited By");
$this->get_page("post/list/favorited_by=test/1");
$this->assertTitle("Image $image_id: test");
$this->assertText("Favorited By");
$this->click("Un-Favorite");
$this->assertNoText("Favorited By");
$this->log_out();
$this->log_in_as_admin();
$this->delete_image($image_id);
$this->log_out();
}
}
?>

View File

@ -36,7 +36,7 @@ class FavoritesTheme extends Themelet {
$html .= "<br><a href='".make_link("user/$username")."'>$username</a>"; $html .= "<br><a href='".make_link("user/$username")."'>$username</a>";
} }
$page->add_block(new Block("Favorited by", $html, "left", 25)); $page->add_block(new Block("Favorited By", $html, "left", 25));
} }
} }