|
43 | 43 | end |
44 | 44 |
|
45 | 45 | it "puts all the posts in the feed.xml file" do |
46 | | - expect(contents).to match "http://example.org/updates/2014/03/04/march-the-fourth.html" |
| 46 | + expect(contents).to match "http://example.org/updates/jekyll/2014/03/04/march-the-fourth.html" |
47 | 47 | expect(contents).to match "http://example.org/news/2014/03/02/march-the-second.html" |
48 | 48 | expect(contents).to match "http://example.org/news/2013/12/12/dec-the-second.html" |
49 | 49 | expect(contents).to match "http://example.org/2015/08/08/stuck-in-the-middle.html" |
|
240 | 240 | end |
241 | 241 |
|
242 | 242 | it "correctly adds the baseurl to the posts" do |
243 | | - expect(contents).to match "http://example.org/bass/updates/2014/03/04/march-the-fourth.html" |
| 243 | + expect(contents).to match "http://example.org/bass/updates/jekyll/2014/03/04/march-the-fourth.html" |
244 | 244 | expect(contents).to match "http://example.org/bass/news/2014/03/02/march-the-second.html" |
245 | 245 | expect(contents).to match "http://example.org/bass/news/2013/12/12/dec-the-second.html" |
246 | 246 | end |
|
405 | 405 | let(:news_feed) { File.read(dest_dir("feed/news.xml")) } |
406 | 406 |
|
407 | 407 | it "outputs the primary feed" do |
408 | | - expect(contents).to match "http://example.org/updates/2014/03/04/march-the-fourth.html" |
| 408 | + expect(contents).to match "http://example.org/updates/jekyll/2014/03/04/march-the-fourth.html" |
409 | 409 | expect(contents).to match "http://example.org/news/2014/03/02/march-the-second.html" |
410 | 410 | expect(contents).to match "http://example.org/news/2013/12/12/dec-the-second.html" |
411 | 411 | expect(contents).to match "http://example.org/2015/08/08/stuck-in-the-middle.html" |
|
416 | 416 | expect(news_feed).to match '<title type="html">My awesome site | News</title>' |
417 | 417 | expect(news_feed).to match "http://example.org/news/2014/03/02/march-the-second.html" |
418 | 418 | expect(news_feed).to match "http://example.org/news/2013/12/12/dec-the-second.html" |
419 | | - expect(news_feed).to_not match "http://example.org/updates/2014/03/04/march-the-fourth.html" |
| 419 | + expect(news_feed).to_not match "http://example.org/updates/jekyll/2014/03/04/march-the-fourth.html" |
420 | 420 | expect(news_feed).to_not match "http://example.org/2015/08/08/stuck-in-the-middle.html" |
421 | 421 | end |
422 | 422 | end |
|
436 | 436 | let(:news_feed) { File.read(dest_dir("feed/news.xml")) } |
437 | 437 |
|
438 | 438 | it "outputs the primary feed" do |
439 | | - expect(contents).to match "http://example.org/updates/2014/03/04/march-the-fourth.html" |
| 439 | + expect(contents).to match "http://example.org/updates/jekyll/2014/03/04/march-the-fourth.html" |
440 | 440 | expect(contents).to match "http://example.org/news/2014/03/02/march-the-second.html" |
441 | 441 | expect(contents).to match "http://example.org/news/2013/12/12/dec-the-second.html" |
442 | 442 | expect(contents).to match "http://example.org/2015/08/08/stuck-in-the-middle.html" |
|
447 | 447 | expect(news_feed).to match '<title type="html">My awesome site | News</title>' |
448 | 448 | expect(news_feed).to match "http://example.org/news/2014/03/02/march-the-second.html" |
449 | 449 | expect(news_feed).to match "http://example.org/news/2013/12/12/dec-the-second.html" |
450 | | - expect(news_feed).to_not match "http://example.org/updates/2014/03/04/march-the-fourth.html" |
| 450 | + expect(news_feed).to_not match "http://example.org/updates/jekyll/2014/03/04/march-the-fourth.html" |
451 | 451 | expect(news_feed).to_not match "http://example.org/2015/08/08/stuck-in-the-middle.html" |
452 | 452 | end |
453 | 453 | end |
|
472 | 472 | expect(collection_feed).to match '<title type="html">My awesome site | Collection</title>' |
473 | 473 | expect(collection_feed).to match "http://example.org/collection/2018-01-01-collection-doc.html" |
474 | 474 | expect(collection_feed).to match "http://example.org/collection/2018-01-02-collection-category-doc.html" |
475 | | - expect(collection_feed).to_not match "http://example.org/updates/2014/03/04/march-the-fourth.html" |
| 475 | + expect(collection_feed).to_not match "http://example.org/updates/jekyll/2014/03/04/march-the-fourth.html" |
476 | 476 | expect(collection_feed).to_not match "http://example.org/2015/08/08/stuck-in-the-middle.html" |
477 | 477 | end |
478 | 478 | end |
|
525 | 525 | expect(news_feed).to match '<title type="html">My awesome site | Collection | News</title>' |
526 | 526 | expect(news_feed).to match "http://example.org/collection/2018-01-02-collection-category-doc.html" |
527 | 527 | expect(news_feed).to_not match "http://example.org/collection/2018-01-01-collection-doc.html" |
528 | | - expect(news_feed).to_not match "http://example.org/updates/2014/03/04/march-the-fourth.html" |
| 528 | + expect(news_feed).to_not match "http://example.org/updates/jekyll/2014/03/04/march-the-fourth.html" |
529 | 529 | expect(news_feed).to_not match "http://example.org/2015/08/08/stuck-in-the-middle.html" |
530 | 530 | end |
531 | 531 | end |
|
556 | 556 | end |
557 | 557 | end |
558 | 558 | end |
| 559 | + |
| 560 | + context "excerpt_only flag" do |
| 561 | + context "backward compatibility for no excerpt_only flag" do |
| 562 | + it "should be in contents" do |
| 563 | + expect(contents).to match '<content ' |
| 564 | + end |
| 565 | + end |
| 566 | + |
| 567 | + context "when site.excerpt_only flag is true" do |
| 568 | + let(:overrides) do |
| 569 | + { "feed" => { "excerpt_only" => true } } |
| 570 | + end |
| 571 | + |
| 572 | + it "should not set any contents" do |
| 573 | + expect(contents).to_not match '<content ' |
| 574 | + end |
| 575 | + end |
| 576 | + |
| 577 | + context "when site.excerpt_only flag is false" do |
| 578 | + let(:overrides) do |
| 579 | + { "feed" => { "excerpt_only" => false } } |
| 580 | + end |
| 581 | + |
| 582 | + it "should be in contents" do |
| 583 | + expect(contents).to match '<content ' |
| 584 | + end |
| 585 | + end |
| 586 | + |
| 587 | + context "when post.excerpt_only flag is true" do |
| 588 | + let(:overrides) do |
| 589 | + { "feed" => { "excerpt_only" => false } } |
| 590 | + end |
| 591 | + |
| 592 | + it "should not be in contents" do |
| 593 | + expect(contents).to_not match "This content should not be in feed.</content>" |
| 594 | + end |
| 595 | + end |
| 596 | + end |
559 | 597 | end |
0 commit comments