Sha256: 0a13adaa375b585e2b46c31ae0b9d9f5fd6159b890f297f2d439c5958c977500

Contents?: true

Size: 1.06 KB

Versions: 9

Compression:

Stored size: 1.06 KB

Contents

require 'spec_helper'
require 'jekyll-last-modified-at'

describe(Jekyll::JekyllSitemap) do
  let(:overrides) do
    {
      "source"      => source_dir,
      "destination" => dest_dir,
      "url"         => "http://example.org",
      "collections" => {
        "my_collection" => { "output" => true },
        "other_things"  => { "output" => false }
      }
    }
  end
  let(:config) do
    Jekyll.configuration(overrides)
  end
  let(:site)     { Jekyll::Site.new(config) }
  let(:contents) { File.read(dest_dir("sitemap.xml")) }
  before(:each) do
    site.process
  end

  context "with jekyll-last-modified-at" do
    it "correctly adds the modified time to the posts" do
      expect(contents).to match  /<loc>http:\/\/example.org\/2015\/01\/18\/jekyll-last-modified-at.html<\/loc>\s+<lastmod>2015-01-19T07:03:38\+00:00<\/lastmod>/
    end

    it "correctly adds the modified time to the pages" do
      expect(contents).to match  /<loc>http:\/\/example.org\/jekyll-last-modified-at\/page.html<\/loc>\s+<lastmod>2015-01-19T07:03:38\+00:00<\/lastmod>/
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
jekyll-sitemap-1.1.1 spec/test_jekyll-last-modified-at.rb
jekyll-sitemap-1.1.0 spec/test_jekyll-last-modified-at.rb
jekyll-sitemap-1.0.0 spec/test_jekyll-last-modified-at.rb
jekyll-sitemap-0.13.0 spec/test_jekyll-last-modified-at.rb
jekyll-sitemap-0.12.0 spec/test_jekyll-last-modified-at.rb
jekyll-sitemap-0.11.0 spec/test_jekyll-last-modified-at.rb
jekyll-sitemap-0.10.0 spec/test_jekyll-last-modified-at.rb
jekyll-sitemap-0.9.0 spec/test_jekyll-last-modified-at.rb
jekyll-sitemap-0.8.1 spec/test_jekyll-last-modified-at.rb