1 defmodule Pleroma.Web.RichMedia.ParserTest do
2 use ExUnit.Case, async: true
8 url: "http://example.com/ogp"
10 %Tesla.Env{status: 200, body: File.read!("test/fixtures/rich_media/ogp.html")}
12 %{method: :get, url: "http://example.com/empty"} ->
13 %Tesla.Env{status: 200, body: "hello"}
19 test "returns error when no metadata present" do
20 assert {:error, _} = Pleroma.Web.RichMedia.Parser.parse("http://example.com/empty")
24 assert Pleroma.Web.RichMedia.Parser.parse("http://example.com/ogp") ==
27 image: "http://ia.media-imdb.com/images/rock.jpg",
30 url: "http://www.imdb.com/title/tt0117500/"