Merge branch 'develop' into issue/1383
[akkoma] / test / web / rich_media / parsers / twitter_card_test.exs
index e2610f4c2905636d92ad998bbb35dcbb940bdb76..751ca614c95639cf4d90ee75c8c7d6b15a8e1b64 100644 (file)
@@ -85,4 +85,19 @@ defmodule Pleroma.Web.RichMedia.Parsers.TwitterCardTest do
                 image: image_path
               }}
   end
+
+  test "takes first founded title in html head if there is html markup error" do
+    html = File.read!("test/fixtures/nypd-facial-recognition-children-teenagers4.html")
+
+    assert TwitterCard.parse(html, %{}) ==
+             {:ok,
+              %{
+                site: nil,
+                title:
+                  "She Was Arrested at 14. Then Her Photo Went to a Facial Recognition Database. - The New York Times",
+                "app:id:googleplay": "com.nytimes.android",
+                "app:name:googleplay": "NYTimes",
+                "app:url:googleplay": "nytimes://reader/id/100000006583622"
+              }}
+  end
 end