]> BookStack Code Mirror - bookstack/blobdiff - tests/Api/ApiConfigTest.php
Fix "Ubunto Mono" $mono type misspelling
[bookstack] / tests / Api / ApiConfigTest.php
index d9367741f55d02672d7a2424ac5040d9956657c3..def62c94dd40465899f3e794e2c6b7897a963ff4 100644 (file)
@@ -1,9 +1,6 @@
-<?php
+<?php namespace Tests\Api;
 
-namespace Tests;
-
-use BookStack\Auth\Permissions\RolePermission;
-use Carbon\Carbon;
+use Tests\TestCase;
 
 class ApiConfigTest extends TestCase
 {
@@ -44,4 +41,15 @@ class ApiConfigTest 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