WIP. Implement oembed route and handle both json/xml for "Note" type activity
This commit is contained in:
parent
21afdf6d99
commit
8902942128
9 changed files with 142 additions and 5 deletions
23
test/web/oembed/oembed_test.exs
Normal file
23
test/web/oembed/oembed_test.exs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
defmodule Pleroma.Web.OEmbedTest do
|
||||
use Pleroma.DataCase
|
||||
alias Pleroma.Web.OEmbed
|
||||
alias Pleroma.Web.XML
|
||||
alias Pleroma.{Object, Repo, User, Activity}
|
||||
import Pleroma.Factory
|
||||
import ExUnit.CaptureLog
|
||||
|
||||
setup_all do
|
||||
:ok
|
||||
end
|
||||
|
||||
test 'recognizes notices in given url' do
|
||||
url = "https://pleroma.site/notice/5"
|
||||
assert { :activity, _ } = OEmbed.recognize_path(url)
|
||||
end
|
||||
|
||||
test 'recognizes user card in given url' do
|
||||
url = "https://pleroma.site/users/raeno"
|
||||
assert { :user, _ } = OEmbed.recognize_path(url)
|
||||
end
|
||||
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue