Merge pull request #3473 from cvergne/fix-rssall

Fix All RSS not accessible if not logged in + Tests
This commit is contained in:
Nicolas Lœuillet 2017-12-11 19:38:21 +01:00 committed by GitHub
commit c31daf4725
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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();