Merge pull request #5542 from ashmaroli/url-slash

Merge pull request 5542
This commit is contained in:
jekyllbot 2017-01-17 20:21:48 -05:00 committed by GitHub
commit 76e9b8d266
1 changed files with 18 additions and 0 deletions

View File

@ -373,6 +373,24 @@ class TestFilters < JekyllUnitTest
assert_equal "http://example.com/base", filter.absolute_url(page_url)
end
should "not append a forward slash if input is '/'" do
page_url = "/"
filter = make_filter_mock({
"url" => "http://example.com",
"baseurl" => "/base"
})
assert_equal "http://example.com/base/", filter.absolute_url(page_url)
end
should "not append a forward slash if input is '/' and nil 'baseurl'" do
page_url = "/"
filter = make_filter_mock({
"url" => "http://example.com",
"baseurl" => nil
})
assert_equal "http://example.com/", filter.absolute_url(page_url)
end
should "normalize international URLs" do
page_url = ""
filter = make_filter_mock({