|
244 | 244 | end
|
245 | 245 | end
|
246 | 246 |
|
| 247 | + context "with site.logo and page.author" do |
| 248 | + let(:site) { make_site("logo" => "http://cdn.example.invalid/logo.png", "url" => "http://example.invalid", "author" => "Mr. Foo") } |
| 249 | + |
| 250 | + it "outputs the author" do |
| 251 | + expect(json_data["publisher"]["name"]).to eql("Mr. Foo") |
| 252 | + end |
| 253 | + end |
| 254 | + |
| 255 | + context "with page author" do |
| 256 | + let(:site) { make_site("logo" => "/logo.png", "url" => "http://example.invalid") } |
| 257 | + let(:page) { make_post("author" => "Mr. Foo") } |
| 258 | + |
| 259 | + it "outputs the author" do |
| 260 | + expect(json_data["author"]["@type"]).to eql("Person") |
| 261 | + expect(json_data["author"]["name"]).to eql("Mr. Foo") |
| 262 | + end |
| 263 | + |
| 264 | + it "outputs the publisher author" do |
| 265 | + expect(json_data["publisher"]["name"]).to eql("Mr. Foo") |
| 266 | + end |
| 267 | + end |
| 268 | + |
| 269 | + context "with seo type is BlogPosting" do |
| 270 | + let(:site) { make_site("url" => "http://example.invalid") } |
| 271 | + let(:page) { make_post("seo" => { "type" => "BlogPosting" }, "permalink" => "/foo/") } |
| 272 | + |
| 273 | + it "outputs the mainEntityOfPage" do |
| 274 | + expect(json_data["mainEntityOfPage"]["@type"]).to eql("WebPage") |
| 275 | + expect(json_data["mainEntityOfPage"]["@id"]).to eql("http://example.invalid/foo/") |
| 276 | + end |
| 277 | + end |
| 278 | + |
| 279 | + context "with seo type is CreativeWork" do |
| 280 | + let(:site) { make_site("url" => "http://example.invalid") } |
| 281 | + let(:page) { make_post("seo" => { "type" => "CreativeWork" }, "permalink" => "/foo/") } |
| 282 | + |
| 283 | + it "outputs the mainEntityOfPage" do |
| 284 | + expect(json_data["mainEntityOfPage"]["@type"]).to eql("WebPage") |
| 285 | + expect(json_data["mainEntityOfPage"]["@id"]).to eql("http://example.invalid/foo/") |
| 286 | + end |
| 287 | + end |
| 288 | + |
247 | 289 | context "with site.title" do
|
248 | 290 | let(:site) { make_site("title" => "Foo", "url" => "http://example.invalid") }
|
249 | 291 |
|
|
0 commit comments