2009-07-19 19:35:46 +01:00
|
|
|
<?php
|
2015-09-20 22:40:04 +01:00
|
|
|
class FeaturedTest extends ShimmiePHPUnitTestCase {
|
2015-09-26 11:17:13 +01:00
|
|
|
public function testFeatured() {
|
2009-07-19 19:35:46 +01:00
|
|
|
$this->log_in_as_user();
|
2015-08-09 12:14:28 +01:00
|
|
|
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pbx");
|
2009-07-19 19:35:46 +01:00
|
|
|
|
2009-07-20 07:31:41 +01: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 01:28:48 +01:00
|
|
|
$this->assert_title("Image $image_id: pbx");
|
2015-09-20 22:40:04 +01:00
|
|
|
|
2015-09-21 10:05:32 +01:00
|
|
|
$this->markTestIncomplete();
|
|
|
|
|
2009-07-19 19:35:46 +01:00
|
|
|
$this->click("Feature This");
|
2012-03-09 22:08:55 +00:00
|
|
|
$this->get_page("post/list");
|
2009-08-19 01:28:48 +01: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 19:35:46 +01: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 01:28:48 +01:00
|
|
|
$this->assert_no_text("Featured Image");
|
2009-07-19 19:35:46 +01:00
|
|
|
}
|
|
|
|
}
|
2014-04-24 22:22:16 -04:00
|
|
|
|