2009-07-19 18:35:46 +00:00
|
|
|
<?php
|
2015-09-20 21:40:04 +00:00
|
|
|
class FeaturedTest extends ShimmiePHPUnitTestCase {
|
2015-09-26 10:17:13 +00:00
|
|
|
public function testFeatured() {
|
2009-07-19 18:35:46 +00:00
|
|
|
$this->log_in_as_user();
|
2015-08-09 11:14:28 +00:00
|
|
|
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pbx");
|
2009-07-19 18:35:46 +00:00
|
|
|
|
2009-07-20 06:31:41 +00:00
|
|
|
# FIXME: test that regular users can't feature things
|
|
|
|
|
|
|
|
$this->log_in_as_admin();
|
2012-03-09 22:08:55 +00:00
|
|
|
$this->get_page("post/view/$image_id");
|
2009-08-19 00:28:48 +00:00
|
|
|
$this->assert_title("Image $image_id: pbx");
|
2015-09-20 21:40:04 +00:00
|
|
|
|
2015-09-21 09:05:32 +00:00
|
|
|
$this->markTestIncomplete();
|
|
|
|
|
2009-07-19 18:35:46 +00:00
|
|
|
$this->click("Feature This");
|
2012-03-09 22:08:55 +00:00
|
|
|
$this->get_page("post/list");
|
2009-08-19 00:28:48 +00:00
|
|
|
$this->assert_text("Featured Image");
|
2012-03-10 17:39:38 +00:00
|
|
|
|
|
|
|
# FIXME: test changing from one feature to another
|
|
|
|
|
|
|
|
$this->get_page("featured_image/download");
|
|
|
|
$this->assert_response(200);
|
|
|
|
|
|
|
|
$this->get_page("featured_image/view");
|
|
|
|
$this->assert_response(200);
|
|
|
|
|
2009-07-19 18:35:46 +00:00
|
|
|
$this->delete_image($image_id);
|
|
|
|
$this->log_out();
|
|
|
|
|
|
|
|
# after deletion, there should be no feature
|
2012-03-09 22:08:55 +00:00
|
|
|
$this->get_page("post/list");
|
2009-08-19 00:28:48 +00:00
|
|
|
$this->assert_no_text("Featured Image");
|
2009-07-19 18:35:46 +00:00
|
|
|
}
|
|
|
|
}
|
2014-04-25 02:22:16 +00:00
|
|
|
|