diff --git a/app/views/public/api/v1/portals/sitemap.xml.erb b/app/views/public/api/v1/portals/sitemap.xml.erb
index d3e2b8301..1ea828165 100644
--- a/app/views/public/api/v1/portals/sitemap.xml.erb
+++ b/app/views/public/api/v1/portals/sitemap.xml.erb
@@ -1,9 +1,9 @@
-
+
<% @portal.articles.where(status: :published).each do |article| %>
-
+
<%= @help_center_url %><%= generate_article_link(@portal.slug, article.slug, false, false) %>
- <%= article.updated_at.strftime("%Y-%m-%d") %>
-
+ <%= article.updated_at.to_date.iso8601 %>
+
<% end %>
-
\ No newline at end of file
+
diff --git a/spec/controllers/public/api/v1/portals_controller_spec.rb b/spec/controllers/public/api/v1/portals_controller_spec.rb
index 92ab56e5b..9cc77a19c 100644
--- a/spec/controllers/public/api/v1/portals_controller_spec.rb
+++ b/spec/controllers/public/api/v1/portals_controller_spec.rb
@@ -60,24 +60,35 @@ RSpec.describe Public::Api::V1::PortalsController, type: :request do
describe 'GET /public/api/v1/portals/{portal_slug}/sitemap' do
context 'when custom_domain is present' do
- it 'gets a valid sitemap' do
+ it 'returns a valid urlset sitemap with the correct namespace' do
get "/hc/#{portal.slug}/sitemap.xml"
+
expect(response).to have_http_status(:success)
- expect(response.body).to match(/