]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Fix All RSS not accessible if not logged in + Tests 3473/head
authorChristophe VERGNE <christophe.vergne@gmail.com>
Mon, 11 Dec 2017 15:04:06 +0000 (16:04 +0100)
committerChristophe VERGNE <christophe.vergne@gmail.com>
Mon, 11 Dec 2017 15:04:06 +0000 (16:04 +0100)
app/config/security.yml
tests/Wallabag/CoreBundle/Controller/RssControllerTest.php

index e14a0bd19b1924ea34d6f85e787b2c6c7c290948..796dc361e1ea202e67cd3f610f283f81502d1020 100644 (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 }
index c6ca49374cd002086226fa66714102b7992d462e..2af6e14f3d80b1a352db946ab0a4ce2554ce9d31 100644 (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();