mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-23 01:21:03 +00:00
Add test to prevent regression for #3534
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
This commit is contained in:
parent
8e15ece7df
commit
e0a862b626
1 changed files with 20 additions and 0 deletions
|
@ -5,6 +5,7 @@ namespace Tests\Wallabag\CoreBundle\Controller;
|
|||
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
||||
use Wallabag\CoreBundle\Entity\Config;
|
||||
use Wallabag\CoreBundle\Entity\Entry;
|
||||
use Wallabag\CoreBundle\Entity\Tag;
|
||||
use Wallabag\CoreBundle\Entity\SiteCredential;
|
||||
use Wallabag\CoreBundle\Helper\ContentProxy;
|
||||
|
||||
|
@ -1478,4 +1479,23 @@ class EntryControllerTest extends WallabagCoreTestCase
|
|||
$this->assertSame('email_tracking.pdf', $content->getTitle());
|
||||
$this->assertSame('example.com', $content->getDomainName());
|
||||
}
|
||||
|
||||
public function testEntryDeleteTagLink()
|
||||
{
|
||||
$this->logInAs('admin');
|
||||
$client = $this->getClient();
|
||||
|
||||
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
|
||||
$entry = $em->getRepository('WallabagCoreBundle:Entry')->findByUrlAndUserId('http://0.0.0.0/entry1', $this->getLoggedInUserId());
|
||||
$tag = $entry->getTags()[0];
|
||||
|
||||
$crawler = $client->request('GET', '/view/' . $entry->getId());
|
||||
|
||||
// As long as the deletion link of a tag is following
|
||||
// a link to the tag view, we take the second one to retrieve
|
||||
// the deletion link of the first tag
|
||||
$link = $crawler->filter('body div#article div.tools ul.tags li.chip a')->extract('href')[1];
|
||||
|
||||
$this->assertSame(sprintf('/remove-tag/%s/%s', $entry->getId(), $tag->getId()), $link);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue