]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php
Add ability to revoke feed token
[github/wallabag/wallabag.git] / tests / Wallabag / CoreBundle / Controller / ConfigControllerTest.php
index d8478ce3e13ea17ef27fb8fe9ea955df48893e81..b9e0bed25118c27faaddcd223617fe572f4132f4 100644 (file)
@@ -330,7 +330,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
         $crawler = $client->followRedirect();
 
         $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
-        $this->assertNotContains('config.form_feed.no_token', $body[0]);
+        $this->assertContains('config.form_feed.token_reset', $body[0]);
     }
 
     public function testGenerateTokenAjax()
@@ -351,6 +351,22 @@ class ConfigControllerTest extends WallabagCoreTestCase
         $this->assertArrayHasKey('token', $content);
     }
 
+    public function testRevokeTokenAjax()
+    {
+        $this->logInAs('admin');
+        $client = $this->getClient();
+
+        $client->request(
+            'GET',
+            '/revoke-token',
+            [],
+            [],
+            ['HTTP_X-Requested-With' => 'XMLHttpRequest']
+        );
+
+        $this->assertSame(200, $client->getResponse()->getStatusCode());
+    }
+
     public function testFeedUpdate()
     {
         $this->logInAs('admin');