diff options
author | raeno <just.raeno@gmail.com> | 2018-12-10 23:08:02 +0400 |
---|---|---|
committer | raeno <just.raeno@gmail.com> | 2018-12-13 22:17:53 +0100 |
commit | 8902942128e3aee814c215d700e2eaee21b491e9 (patch) | |
tree | d7a4cacd3d91a89550589e46ea2faefbf8f5e491 /test | |
parent | 21afdf6d9966265de95df860d90d250c76bdbe08 (diff) | |
download | pleroma-8902942128e3aee814c215d700e2eaee21b491e9.tar.gz |
WIP. Implement oembed route and handle both json/xml for "Note" type activity
Diffstat (limited to 'test')
-rw-r--r-- | test/web/oembed/oembed_test.exs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/web/oembed/oembed_test.exs b/test/web/oembed/oembed_test.exs new file mode 100644 index 000000000..16c2c3598 --- /dev/null +++ b/test/web/oembed/oembed_test.exs @@ -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 |