Sha256: 2173d8f2f8e1524aadf7acc25cbd61330a1814e27875b6179bc14af3e4a36c70
Contents?: true
Size: 968 Bytes
Versions: 17
Compression:
Stored size: 968 Bytes
Contents
require 'spec_helper' describe "SitemapGenerator" do it "should add the geo sitemap element" do loc = 'http://www.example.com/geo_page.kml' format = 'kml' geo_xml_fragment = SitemapGenerator::Builder::SitemapUrl.new('geo_page.kml', :host => 'http://www.example.com', :geo => { :format => format } ).to_xml # Check that the options were parsed correctly doc = Nokogiri::XML.parse("<root xmlns:geo='#{SitemapGenerator::SCHEMAS['geo']}'>#{geo_xml_fragment}</root>") url = doc.at_xpath("//url") url.should_not be_nil url.at_xpath("loc").text.should == loc geo = url.at_xpath("geo:geo") geo.should_not be_nil geo.at_xpath("geo:format").text.should == format # Google's documentation and published schema don't match some valid elements may # not validate. xml_fragment_should_validate_against_schema(geo, 'sitemap-geo', 'xmlns:geo' => SitemapGenerator::SCHEMAS['geo']) end end
Version data entries
17 entries across 17 versions & 3 rubygems