Sha256: f80a37a6911f6c9fb4bb07b35973d91d2afa2f8c29ba52eb38597f2c983b028a

Contents?: true

Size: 979 Bytes

Versions: 1

Compression:

Stored size: 979 Bytes

Contents

require 'spec_helper'
require 'nokogiri'

describe "Search engine sitemaps", :feature do
  include XmlHelpers

  it "produces a sitemap" do
    run_site 'dummy' do
      set :url_root, 'http://example.com'

      activate :search_engine_sitemap
    end

    visit '/sitemap.xml'
    
    schema = File.expand_path('../../../sitemap.xsd', __FILE__)
    doc = Nokogiri::XML(last_response.body)
    expect(doc).to validate_against_schema(schema)

    expect(doc).to contain_node('url').with_children(
      'loc'        => 'http://example.com/home.html',
      'priority'   => '0.5',
      'changefreq' => 'monthly'
    )

    expect(doc).to contain_node('url').with_children(
      'loc'        => 'http://example.com/about.html',
      'priority'   => '0.2',
      'changefreq' => 'monthly'
    )

    expect(doc).to contain_node('url').with_children(
      'loc'        => 'http://example.com/blog.html',
      'priority'   => '0.5',
      'changefreq' => 'daily'
    )
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
middleman-search_engine_sitemap-1.0.0.rc spec/features/sitemap_feature_spec.rb