Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
499B

  1. defmodule Pleroma.UploadTest do
  2. alias Pleroma.Upload
  3. use Pleroma.DataCase
  4. describe "Storing a file" do
  5. test "copies the file to the configured folder" do
  6. file = %Plug.Upload{content_type: "image/jpg", path: Path.absname("test/fixtures/image.jpg"), filename: "an [image.jpg"}
  7. data = Upload.store(file)
  8. assert data["name"] == "an [image.jpg"
  9. assert List.first(data["url"])["href"] == "http://localhost:4001/media/#{data["uuid"]}/an%20%5Bimage.jpg"
  10. end
  11. end
  12. end