From a7e2218e253138ed53e18b4775dce291c78246c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 15 Apr 2016 13:42:13 +0200 Subject: Add test and fix migration --- .../CoreBundle/Controller/EntryControllerTest.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests/Wallabag/CoreBundle') diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index 5c739c78..3b54f057 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php @@ -698,4 +698,22 @@ class EntryControllerTest extends WallabagCoreTestCase $crawler = $client->submit($form, $data); $this->assertCount(2, $crawler->filter('div[class=entry]')); } + + public function testCache() + { + $this->logInAs('admin'); + $client = $this->getClient(); + + $content = $client->getContainer() + ->get('doctrine.orm.entity_manager') + ->getRepository('WallabagCoreBundle:Entry') + ->findOneByUser($this->getLoggedInUserId()); + + $client->request('GET', '/share/'.$content->getUuid()); + $this->assertContains('max-age=25200, public', $client->getResponse()->headers->get('cache-control')); + $this->assertNotContains('no-cache', $client->getResponse()->headers->get('cache-control')); + + $client->request('GET', '/view/'.$content->getId()); + $this->assertContains('no-cache', $client->getResponse()->headers->get('cache-control')); + } } -- cgit v1.2.3