mirror of
https://github.com/wallabag/wallabag.git
synced 2024-12-29 11:00:28 +00:00
Merge pull request #3473 from cvergne/fix-rssall
Fix All RSS not accessible if not logged in + Tests
This commit is contained in:
commit
c31daf4725
2 changed files with 26 additions and 1 deletions
|
@ -60,7 +60,7 @@ security:
|
|||
- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
|
||||
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
|
||||
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
|
||||
- { path: /(unread|starred|archive).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
|
||||
- { path: /(unread|starred|archive|all).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
|
||||
- { path: /tags/(.*).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
|
||||
- { path: ^/share, roles: IS_AUTHENTICATED_ANONYMOUSLY }
|
||||
- { path: ^/settings, roles: ROLE_SUPER_ADMIN }
|
||||
|
|
|
@ -61,6 +61,9 @@ class RssControllerTest extends WallabagCoreTestCase
|
|||
[
|
||||
'/wallace/YZIOAUZIAO/archives.xml',
|
||||
],
|
||||
[
|
||||
'/wallace/YZIOAUZIAO/all.xml',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -141,6 +144,28 @@ class RssControllerTest extends WallabagCoreTestCase
|
|||
$this->validateDom($client->getResponse()->getContent(), 'archive', 'archive');
|
||||
}
|
||||
|
||||
public function testAll()
|
||||
{
|
||||
$client = $this->getClient();
|
||||
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
|
||||
$user = $em
|
||||
->getRepository('WallabagUserBundle:User')
|
||||
->findOneByUsername('admin');
|
||||
|
||||
$config = $user->getConfig();
|
||||
$config->setRssToken('SUPERTOKEN');
|
||||
$config->setRssLimit(null);
|
||||
$em->persist($config);
|
||||
$em->flush();
|
||||
|
||||
$client = $this->getClient();
|
||||
$client->request('GET', '/admin/SUPERTOKEN/all.xml');
|
||||
|
||||
$this->assertSame(200, $client->getResponse()->getStatusCode());
|
||||
|
||||
$this->validateDom($client->getResponse()->getContent(), 'all', 'all');
|
||||
}
|
||||
|
||||
public function testPagination()
|
||||
{
|
||||
$client = $this->getClient();
|
||||
|
|
Loading…
Reference in a new issue