Skip to content

Commit 472b25d

Browse files
committed
Fix sitemap generation test
1 parent fe4b976 commit 472b25d

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

test/integration/sitemap_test.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ class SitemapTest < ActionDispatch::IntegrationTest
5151
# Space sitemap should only include content for that space
5252
space_urls = parse_space(space)
5353
assert space_urls.any?
54-
assert_includes space_urls, "https://#{space.host}/about"
55-
assert_includes space_urls, "https://#{space.host}/materials/#{materials(:plant_space_material).friendly_id}"
56-
refute_includes space_urls, "https://#{space.host}/materials/#{materials(:good_material).friendly_id}"
54+
assert_includes space_urls, "#{space.url}/about"
55+
assert_includes space_urls, "#{space.url}/materials/#{materials(:plant_space_material).friendly_id}"
56+
refute_includes space_urls, "#{space.url}/materials/#{materials(:good_material).friendly_id}"
5757
end
5858

5959
private
@@ -70,13 +70,13 @@ def raw_sitemap
7070
end
7171

7272
def parse
73-
LocalSitemapParser.new('http://www.example.com/sitemap.xml', { recurse: true }).to_a.uniq.map(&:strip)
73+
LocalSitemapParser.new("#{TeSS::Config.base_url}/sitemap.xml", { recurse: true }).to_a.uniq.map(&:strip)
7474
end
7575

7676
def parse_space(space)
7777
# The index URL uses the space's host as both the URL authority and the subdirectory path,
7878
# since sitemaps are stored under sitemaps/<space.host>/ and served via that same host.
79-
index_url = "https://#{space.host}/test_sitemaps/#{space.host}/sitemap.xml"
79+
index_url = "#{space.url}/test_sitemaps/#{space.host}/sitemap.xml"
8080
LocalSitemapParser.new(index_url, { recurse: true }).to_a.uniq.map(&:strip)
8181
end
8282
end

0 commit comments

Comments
 (0)