From cb81364a774b6282863c5e417689694dbcae0dca Mon Sep 17 00:00:00 2001 From: Ben Balter Date: Tue, 19 Apr 2016 10:05:21 -0400 Subject: [PATCH] add tests --- spec/jekyll_seo_tag_spec.rb | 43 ++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/spec/jekyll_seo_tag_spec.rb b/spec/jekyll_seo_tag_spec.rb index b3fae8f..49920f1 100644 --- a/spec/jekyll_seo_tag_spec.rb +++ b/spec/jekyll_seo_tag_spec.rb @@ -110,7 +110,7 @@ describe Jekyll::SeoTag do end end - context 'with page.image' do + context 'with page.image as a string' do let(:page) { make_page('image' => '/img/foo.png') } it 'outputs the image' do @@ -119,6 +119,47 @@ describe Jekyll::SeoTag do end end + context 'with page.image as an object' do + context 'when given a path' do + let(:page) { make_page('image' => { 'path' => '/img/foo.png' } ) } + + it 'outputs the image' do + expected = %r{} + expect(output).to match(expected) + end + end + + context "when given a facebook image" do + let(:page) { make_page('image' => { 'facebook' => '/img/facebook.png' } ) } + + it 'outputs the image' do + expected = %r{} + expect(output).to match(expected) + end + end + + context "when given a twitter image" do + let(:page) { make_page('image' => { 'twitter' => '/img/twitter.png' } ) } + + it 'outputs the image' do + expected = %r{} + expect(output).to match(expected) + end + end + + context "when given the image height and width" do + let(:image) { { 'facebook' => '/img/foo.png', 'height' => 1, 'width' => 2 } } + let(:page) { make_page('image' => image) } + + it 'outputs the image' do + expected = %r{} + expect(output).to match(expected) + expected = %r{} + expect(output).to match(expected) + end + end + end + context 'with site.logo' do let(:site) { make_site('logo' => '/logo.png', 'url' => 'http://example.invalid') }