using `stub` instead `expect`
[akkoma] / test / http / adapter_helper / hackney_test.exs
index 82f5a7883cc131f3bae8d633ef9ee03eb77a47c5..5fda075f63a2cb9bb9f0a2d08807fc625f228ad5 100644 (file)
@@ -1,9 +1,9 @@
 # Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
 defmodule Pleroma.HTTP.AdapterHelper.HackneyTest do
-  use ExUnit.Case
+  use ExUnit.Case, async: true
   use Pleroma.Tests.Helpers
 
   alias Pleroma.Config
@@ -20,11 +20,7 @@ defmodule Pleroma.HTTP.AdapterHelper.HackneyTest do
     end
 
     test "add proxy and opts from config", %{uri: uri} do
-      proxy = Config.get([:http, :proxy_url])
-      Config.put([:http, :proxy_url], "localhost:8123")
-      on_exit(fn -> Config.put([:http, :proxy_url], proxy) end)
-
-      opts = Hackney.options(uri)
+      opts = Hackney.options([proxy: "localhost:8123"], uri)
 
       assert opts[:a] == 1
       assert opts[:b] == 2