mirror of
https://github.com/wallabag/wallabag.git
synced 2025-07-22 17:18:37 +00:00
Ability to reload an entry
Could be useful when we want to update the content or when the content failed to be fetched. Fix #1503
This commit is contained in:
parent
e6a228c43b
commit
831b02aaf2
4 changed files with 68 additions and 0 deletions
|
@ -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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue