]> BookStack Code Mirror - bookstack/blobdiff - tests/Api/ApiConfigTest.php
Add footer element, styles, and associated settings
[bookstack] / tests / Api / ApiConfigTest.php
index 99b063c69bfcb1b146c65729d819dff19dec7c2e..1b3da2f34f8d19c8c0df42ceccea045dbea208ac 100644 (file)
@@ -5,7 +5,7 @@ namespace Tests;
 use BookStack\Auth\Permissions\RolePermission;
 use Carbon\Carbon;
 
-class ApiAuthTest extends TestCase
+class ApiConfigTest extends TestCase
 {
     use TestsApi;
 
@@ -44,4 +44,15 @@ class ApiAuthTest extends TestCase
         $resp->assertJsonCount(2, 'data');
     }
 
+    public function test_requests_per_min_alters_rate_limit()
+    {
+        $resp = $this->actingAsApiEditor()->get($this->endpoint);
+        $resp->assertHeader('x-ratelimit-limit', 180);
+
+        config()->set(['api.requests_per_minute' => 10]);
+
+        $resp = $this->actingAsApiEditor()->get($this->endpoint);
+        $resp->assertHeader('x-ratelimit-limit', 10);
+    }
+
 }
\ No newline at end of file