Display full url in sitemap

This commit is contained in:
2015-07-14 14:14:37 +02:00
parent 42cc5afe6d
commit 1d5dd62c68
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ module Cmtool
respond_to do |format|
format.xml do
pages_xml = ::Page.for_sitemap.map do |page|
uri = page_path(page.name, locale: page.locale)
uri = page_url(page.name, locale: page.locale)
"<url><loc>#{uri}</loc><lastmod>#{page.updated_at.strftime('%Y-%m-%d')}</lastmod></url>"
end.join("\n")
result = <<-XML
+2 -2
View File
@@ -6,7 +6,7 @@ feature 'sitemap.xml' do
p1 = Page.create name: 'en-1', title: 'EN 1', locale: 'en'
visit "/sitemap.xml"
page.body.should include "<lastmod>#{Date.today.strftime('%Y-%m-%d')}</lastmod>"
page.body.should include "<loc>/en/en-1</loc>"
page.body.should include "<loc>/nl-1</loc>"
page.body.should include "<loc>http://www.example.com/en/en-1</loc>"
page.body.should include "<loc>http://www.example.com/nl-1</loc>"
end
end