From 8cc9b2d52cc92e96992ac5be2f649f3207ecf514 Mon Sep 17 00:00:00 2001 From: kyle Date: Wed, 18 Jan 2017 14:14:29 -0500 Subject: [PATCH] Add test for image object with dimensions --- spec/jekyll_seo_tag_spec.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/spec/jekyll_seo_tag_spec.rb b/spec/jekyll_seo_tag_spec.rb index d273a26..be695d5 100644 --- a/spec/jekyll_seo_tag_spec.rb +++ b/spec/jekyll_seo_tag_spec.rb @@ -196,6 +196,22 @@ describe Jekyll::SeoTag do end end + context "with image.url, image.height, and image.width" do + let(:meta) do + { + "image" => {"url" => "/img/banner.png","height" => 1,"width" => 2}, + "url" => "http://example.invalid" + } + end + let(:page) { make_post(meta) } + + it "outputs the image object with dimensions" do + expect(json_data["image"]["url"]).to eql("http://example.invalid/img/banner.png") + expect(json_data["image"]["height"]).to eql(1) + expect(json_data["image"]["width"]).to eql(2) + end + end + context "with site.title" do let(:site) { make_site("title" => "Foo", "url" => "http://example.invalid") }