]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
Ability to reload an entry
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Tests / Controller / EntryControllerTest.php
index 9f585d85d722ecf13c89a5d6a287cccd9c0acbca..96f402b0973758cef2fe059bee46e2899d62381e 100644 (file)
@@ -180,6 +180,38 @@ class EntryControllerTest extends WallabagCoreTestCase
         $this->assertContains($content->getTitle(), $client->getResponse()->getContent());
     }
 
+    /**
+     * @depends testPostNewOk
+     *
+     * This test will require an internet connection.
+     */
+    public function testReload()
+    {
+        $this->logInAs('admin');
+        $client = $this->getClient();
+
+        $content = $client->getContainer()
+            ->get('doctrine.orm.entity_manager')
+            ->getRepository('WallabagCoreBundle:Entry')
+            ->findOneByUrl($this->url);
+
+        // empty content
+        $content->setContent('');
+        $client->getContainer()->get('doctrine.orm.entity_manager')->persist($content);
+        $client->getContainer()->get('doctrine.orm.entity_manager')->flush();
+
+        $client->request('GET', '/reload/'.$content->getId());
+
+        $this->assertEquals(302, $client->getResponse()->getStatusCode());
+
+        $content = $client->getContainer()
+            ->get('doctrine.orm.entity_manager')
+            ->getRepository('WallabagCoreBundle:Entry')
+            ->findOneByUrl($this->url);
+
+        $this->assertNotEmpty($content->getContent());
+    }
+
     public function testEdit()
     {
         $this->logInAs('admin');