1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Uploaders.LocalTest do
7 alias Pleroma.Uploaders.Local
9 describe "get_file/1" do
10 test "it returns path to local folder for files" do
11 assert Local.get_file("") == {:ok, {:static_dir, "test/uploads"}}
15 describe "put_file/1" do
16 test "put file to local folder" do
17 file_path = "local_upload/files/image.jpg"
19 file = %Pleroma.Upload{
21 content_type: "image/jpg",
23 tempfile: Path.absname("test/fixtures/image_tmp.jpg")
26 assert Local.put_file(file) == :ok
28 assert Path.join([Local.upload_path(), file_path])