summaryrefslogtreecommitdiff
path: root/test/http
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2020-03-08 10:38:35 +0000
committerrinpatch <rinpatch@sdf.org>2020-03-08 10:38:35 +0000
commite8493431bfc16977e43715bf8bdb09ac46580028 (patch)
tree2e1a0068583ca62870a15590c4ccba237999f51a /test/http
parent42f76306e7fe69fc51be00285a4fef8569f54989 (diff)
parente7c49d51d724680c1f19888ea409687733753c7b (diff)
downloadpleroma-e8493431bfc16977e43715bf8bdb09ac46580028.tar.gz
pleroma-e8493431bfc16977e43715bf8bdb09ac46580028.zip
Merge branch 'release/2.0.0' into 'stable'
Release/2.0.0 See merge request pleroma/pleroma!2273
Diffstat (limited to 'test/http')
-rw-r--r--test/http/request_builder_test.exs13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/http/request_builder_test.exs b/test/http/request_builder_test.exs
index 170ca916f..11a9314ae 100644
--- a/test/http/request_builder_test.exs
+++ b/test/http/request_builder_test.exs
@@ -1,5 +1,5 @@
# 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.RequestBuilderTest do
@@ -9,6 +9,7 @@ defmodule Pleroma.HTTP.RequestBuilderTest do
describe "headers/2" do
clear_config([:http, :send_user_agent])
+ clear_config([:http, :user_agent])
test "don't send pleroma user agent" do
assert RequestBuilder.headers(%{}, []) == %{headers: []}
@@ -16,11 +17,21 @@ defmodule Pleroma.HTTP.RequestBuilderTest do
test "send pleroma user agent" do
Pleroma.Config.put([:http, :send_user_agent], true)
+ Pleroma.Config.put([:http, :user_agent], :default)
assert RequestBuilder.headers(%{}, []) == %{
headers: [{"User-Agent", Pleroma.Application.user_agent()}]
}
end
+
+ test "send custom user agent" do
+ Pleroma.Config.put([:http, :send_user_agent], true)
+ Pleroma.Config.put([:http, :user_agent], "totally-not-pleroma")
+
+ assert RequestBuilder.headers(%{}, []) == %{
+ headers: [{"User-Agent", "totally-not-pleroma"}]
+ }
+ end
end
describe "add_optional_params/3" do