akkoma/test/pleroma/web/plugs
ilja f1dfd76b98 Fix rate_limiter_test.exs test "it restricts based on config values" (#233)
Fixes one of the 'erratic' tests

It used a timer to sleep.
But time also goes on when doing other things, so depending on hardware, the timings could be off.
I slightly changed the tests so we still test what we functionally want.
Instead of waiting until the cache expires I now have a function to expire the test and use that.

That means we're not testing any more if the cache really expires after a certain amount of time,
but that's the responsability of the dependency imo, so shouldn't be a problem.

I also changed `Pleroma.Web.Endpoint, :http, :ip` in the tests to `127.0.0.1`
Currently it was set to 8.8.8.8, but I see no reason for that and, while I assume that no calls
are made to it, it may come over as weird or suspicious to people.

Co-authored-by: Ilja <ilja@ilja.space>
Reviewed-on: AkkomaGang/akkoma#233
Co-authored-by: ilja <akkoma.dev@ilja.space>
Co-committed-by: ilja <akkoma.dev@ilja.space>
2022-11-01 14:25:54 +00:00
..
admin_secret_authentication_plug_test.exs Convert tests to all use clear_config instead of Pleroma.Config.put 2021-01-26 11:58:43 -06:00
authentication_plug_test.exs Pbkdf2: Use it everywhere. 2021-01-14 15:06:16 +01:00
basic_auth_decoder_plug_test.exs Bump Copyright to 2021 2021-01-13 07:49:50 +01:00
cache_control_test.exs Bump Copyright to 2021 2021-01-13 07:49:50 +01:00
cache_test.exs cherry-pick security from upstream 2022-06-22 16:25:05 +01:00
digest_plug_test.exs digest algorithm is taken from header 2020-11-27 08:10:52 +03:00
ensure_authenticated_plug_test.exs Bump Copyright to 2021 2021-01-13 07:49:50 +01:00
ensure_public_or_authenticated_plug_test.exs Convert tests to all use clear_config instead of Pleroma.Config.put 2021-01-26 11:58:43 -06:00
ensure_staff_privileged_plug_test.exs EnsureStaffPrivilegedPlug: add tests 2021-12-27 10:39:59 -06:00
ensure_user_token_assigns_plug_test.exs Bump Copyright to 2021 2021-01-13 07:49:50 +01:00
federating_plug_test.exs Convert tests to all use clear_config instead of Pleroma.Config.put 2021-01-26 11:58:43 -06:00
frontend_static_plug_test.exs Revert "Merge branch 'remove/mastofe' into 'develop'" 2022-01-08 21:44:37 +00:00
http_security_plug_test.exs Allow to define custom HTTP headers per each frontend 2021-01-21 21:55:23 +03:00
http_signature_plug_test.exs GTS: cherry-picks and collection usage (#186) 2022-08-27 18:05:48 +00:00
idempotency_plug_test.exs Bump Copyright to 2021 2021-01-13 07:49:50 +01:00
instance_static_test.exs Remove precompiled javascript (#55) 2022-07-08 13:03:18 +00:00
mapped_signature_to_identity_plug_test.exs Check that the signature matches the creator 2022-10-14 11:48:32 +01:00
o_auth_plug_test.exs Revert "Fix oauth2 (for real) (#179)" 2022-08-21 17:52:02 +01:00
o_auth_scopes_plug_test.exs Remove :auth, :enforce_oauth_admin_scope_usage 2021-02-17 20:47:38 +03:00
plug_helper_test.exs Bump Copyright to 2021 2021-01-13 07:49:50 +01:00
rate_limiter_test.exs Fix rate_limiter_test.exs test "it restricts based on config values" (#233) 2022-11-01 14:25:54 +00:00
remote_ip_test.exs Convert tests to all use clear_config instead of Pleroma.Config.put 2021-01-26 11:58:43 -06:00
set_format_plug_test.exs Bump Copyright to 2021 2021-01-13 07:49:50 +01:00
set_locale_plug_test.exs Lint 2022-06-29 20:47:10 +01:00
set_user_session_id_plug_test.exs Revert "Fix oauth2 (for real) (#179)" 2022-08-21 17:52:02 +01:00
uploaded_media_plug_test.exs Bump Copyright to 2021 2021-01-13 07:49:50 +01:00
user_enabled_plug_test.exs Convert tests to all use clear_config instead of Pleroma.Config.put 2021-01-26 11:58:43 -06:00
user_fetcher_plug_test.exs Bump Copyright to 2021 2021-01-13 07:49:50 +01:00
user_is_admin_plug_test.exs Bump Copyright to 2021 2021-01-13 07:49:50 +01:00
user_is_staff_plug_test.exs Moderators: add UserIsStaffPlug 2021-07-12 21:57:52 -05:00
user_tracking_plug_test.exs Add tests 2021-01-27 18:20:07 +04:00