spec/sitemap_spec.rb in w3clove-0.7.4 vs spec/sitemap_spec.rb in w3clove-0.7.5
- old
+ new
@@ -10,10 +10,11 @@
@sitemap_with_trailing_slash = W3Clove::Sitemap.new('http://eparreno.com')
@sitemap_with_protocol_relative = W3Clove::Sitemap.new('http://protocol-relative.com')
@sitemap_with_protocol_relative_https = W3Clove::Sitemap.new('https://protocol-relative.com')
@sitemap_for_exclusions = W3Clove::Sitemap.new('http://example.com/exclusions')
@sitemap_for_absolute_urls = W3Clove::Sitemap.new('http://w3clove.com/faqs')
+ @sitemap_international = W3Clove::Sitemap.new('http://example.com/international')
MarkupValidator.any_instance.stubs(:validate_uri).returns(stubbed_validator_results)
end
it "should have an URL" do
@@ -102,10 +103,17 @@
@sitemap_for_exclusions.pages[0].url.should == 'http://example.com/exclusions'
@sitemap_for_exclusions.pages[1].url.should == 'http://example.com/'
@sitemap_for_exclusions.pages[2].url.should == 'http://example.com/faqs'
end
+ it "should not crash when URLs have international characters" do
+ @sitemap_international.pages.length.should == 3
+ @sitemap_international.pages[0].url.should == 'http://example.com/international'
+ @sitemap_international.pages[1].url.should == 'http://example.com/romanée'
+ @sitemap_international.pages[2].url.should == 'http://example.com/españa'
+ end
+
context "protocol-relative links" do
it "should include only internal links" do
@sitemap_with_protocol_relative.pages.size.should == 3
@sitemap_with_protocol_relative.pages.map {|p| p.url}.sort.should == ['http://protocol-relative.com',
'http://protocol-relative.com/contact',
@@ -141,6 +149,6 @@
w.should be_an_instance_of W3Clove::Message
w.type.should == :warning
end
end
end
-end
\ No newline at end of file
+end# -*- encoding: utf-8 -*-