diff --git a/spec/jekyll_seo_tag_spec.rb b/spec/jekyll_seo_tag_spec.rb old mode 100644 new mode 100755 index b4f8b9c..38c0360 --- a/spec/jekyll_seo_tag_spec.rb +++ b/spec/jekyll_seo_tag_spec.rb @@ -366,6 +366,55 @@ EOS end end + context "author" do + let(:site) { make_site("author" => "Site Author") } + + context "with site.author" do + it "outputs site author metadata" do + expected = %r!! + expect(output).to match(expected) + end + end + + context "with page.author" do + let(:page) { make_page("author" => "Page Author") } + + it "outputs page author metadata" do + expected = %r!! + expect(output).to match(expected) + end + end + + context "without page.author" do + let(:page) { make_page("author" => "") } + + it "outputs site author metadata" do + expected = %r!! + expect(output).to match(expected) + end + end + + context "with site.data.authors" do + let(:author_data) { { "renshuki" => { "name" => "Site Data Author" } } } + let(:data) { { "authors" => author_data } } + + context "with the author in site.data.authors" do + let(:site) { make_site("data" => data, "author" => "renshuki") } + it "outputs the author metadata" do + expected = %r!! + expect(output).to match(expected) + end + end + + context "without the author in site.data.authors" do + it "outputs site author metadata" do + expected = %r!! + expect(output).to match(expected) + end + end + end + end + context "with site.social" do let(:links) { ["http://foo.invalid", "http://bar.invalid"] } let(:social_namespace) { { "name" => "Ben", "links" => links } }