summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorfeld <feld@feld.me>2021-06-04 17:36:36 +0000
committerfeld <feld@feld.me>2021-06-04 17:36:36 +0000
commit922f4e3fb7452e654d5b9c1b3148df1e663fa788 (patch)
tree6f69a92db2616c2cc69e0253fd5a71ff81bdba4c /test
parenta5dce42c85de2d8316541348335d1dd49c2c3d89 (diff)
parent11844084d0fce0bd94df66561c47ef21b7b38e1d (diff)
downloadpleroma-922f4e3fb7452e654d5b9c1b3148df1e663fa788.tar.gz
pleroma-922f4e3fb7452e654d5b9c1b3148df1e663fa788.zip
Merge branch 'bugfix/erlang-24' into 'develop'
Erlang 24 compatibility Closes #2647 See merge request pleroma/pleroma!3405
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/http/request_builder_test.exs44
-rw-r--r--test/support/factory.ex4
2 files changed, 28 insertions, 20 deletions
diff --git a/test/pleroma/http/request_builder_test.exs b/test/pleroma/http/request_builder_test.exs
index e9b0c4a8a..433beaac1 100644
--- a/test/pleroma/http/request_builder_test.exs
+++ b/test/pleroma/http/request_builder_test.exs
@@ -34,24 +34,32 @@ defmodule Pleroma.HTTP.RequestBuilderTest do
describe "add_param/4" do
test "add file parameter" do
- %Request{
- body: %Tesla.Multipart{
- boundary: _,
- content_type_params: [],
- parts: [
- %Tesla.Multipart.Part{
- body: %File.Stream{
- line_or_bytes: 2048,
- modes: [:raw, :read_ahead, :read, :binary],
- path: "some-path/filename.png",
- raw: true
- },
- dispositions: [name: "filename.png", filename: "filename.png"],
- headers: []
- }
- ]
- }
- } = RequestBuilder.add_param(%Request{}, :file, "filename.png", "some-path/filename.png")
+ assert match?(
+ %Request{
+ body: %Tesla.Multipart{
+ boundary: _,
+ content_type_params: [],
+ parts: [
+ %Tesla.Multipart.Part{
+ body: %File.Stream{
+ line_or_bytes: 2048,
+ modes: [:raw, :read_ahead, :binary],
+ path: "some-path/filename.png",
+ raw: true
+ },
+ dispositions: [name: "filename.png", filename: "filename.png"],
+ headers: []
+ }
+ ]
+ }
+ },
+ RequestBuilder.add_param(
+ %Request{},
+ :file,
+ "filename.png",
+ "some-path/filename.png"
+ )
+ )
end
test "add key to body" do
diff --git a/test/support/factory.ex b/test/support/factory.ex
index 5c4e65c81..c267dba4e 100644
--- a/test/support/factory.ex
+++ b/test/support/factory.ex
@@ -191,8 +191,8 @@ defmodule Pleroma.Factory do
end
def article_factory do
- note_factory()
- |> Map.put("type", "Article")
+ %Pleroma.Object{data: data} = note_factory()
+ %Pleroma.Object{data: Map.merge(data, %{"type" => "Article"})}
end
def tombstone_factory do