Fix All RSS not accessible if not logged in + Tests

This commit is contained in:
Christophe VERGNE 2017-12-11 16:04:06 +01:00
parent e9a4231d4f
commit a40a8038d3
No known key found for this signature in database
GPG key ID: B319977A03877AE2
2 changed files with 26 additions and 1 deletions

View file

@ -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 }

View file

@ -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();