- image: "http://ia.media-imdb.com/images/rock.jpg",
- title: "The Rock",
- type: "video.movie",
- url: "http://www.imdb.com/title/tt0117500/"
+ "image" => "http://ia.media-imdb.com/images/rock.jpg",
+ "title" => "The Rock",
+ "description" =>
+ "Directed by Michael Bay. With Sean Connery, Nicolas Cage, Ed Harris, John Spencer.",
+ "type" => "video.movie",
+ "url" => "http://example.com/ogp"
+ }}
+ end
+
+ test "falls back to <title> when ogp:title is missing" do
+ assert Parser.parse("http://example.com/ogp-missing-title") ==
+ {:ok,
+ %{
+ "image" => "http://ia.media-imdb.com/images/rock.jpg",
+ "title" => "The Rock (1996)",
+ "description" =>
+ "Directed by Michael Bay. With Sean Connery, Nicolas Cage, Ed Harris, John Spencer.",
+ "type" => "video.movie",
+ "url" => "http://example.com/ogp-missing-title"