Skip to content

Commit

Permalink
Merge pull request #32 from edzhelyov/master
Browse files Browse the repository at this point in the history
Generate the correct full url
  • Loading branch information
alexrabarts committed Mar 8, 2012
2 parents aca1dcb + 07e9d44 commit 86c90b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/big_sitemap.rb
Expand Up @@ -179,7 +179,7 @@ def add_urls

with_sitemap do |builder|
@paths.each do |path, options|
url = File.join @options[:base_url], File.path(path)
url = URI.join(@options[:base_url], path)
builder.add_url! url, options
end
end
Expand Down
4 changes: 2 additions & 2 deletions test/big_sitemap_test.rb
Expand Up @@ -44,12 +44,12 @@ def teardown
should 'should add paths' do
generate_sitemap do
add '/', {:last_modified => Time.now, :change_frequency => 'weekly', :priority => 0.5}
add '/about', {:last_modified => Time.now, :change_frequency => 'weekly', :priority => 0.5}
add '/navigation/about/us', {:last_modified => Time.now, :change_frequency => 'weekly', :priority => 0.5}
end

elems = elements first_sitemap_file, 'loc'
assert_equal 'http://example.com/', elems.first.text
assert_equal 'http://example.com/about', elems.last.text
assert_equal 'http://example.com/navigation/about/us', elems.last.text
end

context 'Sitemap index file' do
Expand Down

0 comments on commit 86c90b9

Please sign in to comment.