[#210] [TwitterAPI] Made actor be stored for uploads. Added ownership check
to `update_media` action. Added controller tests for `upload` and `update_media` actions. Refactoring.
This commit is contained in:
parent
53797d19c5
commit
848151f7cb
8 changed files with 120 additions and 40 deletions
|
|
@ -182,13 +182,14 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
|
|||
end
|
||||
|
||||
test "upload a file" do
|
||||
user = insert(:user)
|
||||
file = %Plug.Upload{
|
||||
content_type: "image/jpg",
|
||||
path: Path.absname("test/fixtures/image.jpg"),
|
||||
filename: "an_image.jpg"
|
||||
}
|
||||
|
||||
response = TwitterAPI.upload(file)
|
||||
response = TwitterAPI.upload(file, user)
|
||||
|
||||
assert is_binary(response)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue