spec/sitemap_spec.rb in w3clove-0.6.2 vs spec/sitemap_spec.rb in w3clove-0.7

- old
+ new

@@ -8,10 +8,11 @@ @sitemap_html = W3Clove::Sitemap.new('http://guides.rubyonrails.org') @sitemap_no_links = W3Clove::Sitemap.new('http://zigotica.com') @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') MarkupValidator.any_instance.stubs(:validate_uri).returns(stubbed_validator_results) end it "should have an URL" do @@ -71,9 +72,15 @@ it "should not repeat URLs with and without trailing slash" do urls = @sitemap_with_trailing_slash.pages.collect(&:url) urls.should include 'http://eparreno.com/' urls.should_not include 'http://eparreno.com' + end + + it "should exclude non-html pages" do + @sitemap_for_exclusions.pages.length.should == 2 + @sitemap_for_exclusions.pages.first.url.should == 'http://example.com/exclusions/' + @sitemap_for_exclusions.pages.last.url.should == 'http://example.com/exclusions/faqs' end context "protocol-relative links" do it "should include only internal links" do @sitemap_with_protocol_relative.pages.size.should == 3 \ No newline at end of file