test: rich media: parser: add malformed data regression test
authorWilliam Pitcock <nenolod@dereferenced.org>
Thu, 31 Jan 2019 16:19:53 +0000 (16:19 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Thu, 31 Jan 2019 16:19:53 +0000 (16:19 +0000)
test/web/rich_media/parser_test.exs

index 93a58c52842e738028b01f7886bf78e4e40addb9..47b127cf92b79b6c2cb43c0a80b74d4eb001dfbf 100644 (file)
@@ -88,4 +88,8 @@ defmodule Pleroma.Web.RichMedia.ParserTest do
                 width: "1024"
               }}
   end
+
+  test "rejects invalid OGP data" do
+    assert {:error, _} = Pleroma.Web.RichMedia.Parser.parse("http://example.com/malformed")
+  end
 end