diff options
| author | Maksim Pechnikov <parallel588@gmail.com> | 2019-12-21 20:37:29 +0300 | 
|---|---|---|
| committer | Maksim Pechnikov <parallel588@gmail.com> | 2019-12-21 20:38:59 +0300 | 
| commit | 54c9db38c8035ecc115e136a09a3d991e426959a (patch) | |
| tree | 496afddf614e826c2c76c7d69e3968a3c118e717 /test/plugs | |
| parent | 67cb46e15dd5fa16da257a9b0e5166266d10c694 (diff) | |
| parent | c51e93978ea2aa0f2d5bcc43bf7c925b2590eece (diff) | |
| download | pleroma-54c9db38c8035ecc115e136a09a3d991e426959a.tar.gz pleroma-54c9db38c8035ecc115e136a09a3d991e426959a.zip | |
Merge branch 'develop' into issue/1383
Diffstat (limited to 'test/plugs')
| -rw-r--r-- | test/plugs/rate_limiter_test.exs | 14 | 
1 files changed, 2 insertions, 12 deletions
| diff --git a/test/plugs/rate_limiter_test.exs b/test/plugs/rate_limiter_test.exs index 49f63c424..78f1ea9e4 100644 --- a/test/plugs/rate_limiter_test.exs +++ b/test/plugs/rate_limiter_test.exs @@ -145,9 +145,9 @@ defmodule Pleroma.Plugs.RateLimiterTest do      test "can have limits seperate from unauthenticated connections" do        limiter_name = :test_authenticated -      scale = 1000 +      scale = 50        limit = 5 -      Pleroma.Config.put([:rate_limit, limiter_name], [{1, 10}, {scale, limit}]) +      Pleroma.Config.put([:rate_limit, limiter_name], [{1000, 1}, {scale, limit}])        opts = RateLimiter.init(name: limiter_name) @@ -164,16 +164,6 @@ defmodule Pleroma.Plugs.RateLimiterTest do        assert %{"error" => "Throttled"} = Phoenix.ConnTest.json_response(conn, :too_many_requests)        assert conn.halted - -      Process.sleep(1550) - -      conn = conn(:get, "/") |> assign(:user, user) -      conn = RateLimiter.call(conn, opts) -      assert {1, 4} = RateLimiter.inspect_bucket(conn, limiter_name, opts) - -      refute conn.status == Plug.Conn.Status.code(:too_many_requests) -      refute conn.resp_body -      refute conn.halted      end      test "diffrerent users are counted independently" do | 
