test double slash when input = '/'

This commit is contained in:
Ashwin Maroli 2016-11-04 00:50:54 +05:30
parent b30c499196
commit 894d2a0415
1 changed files with 18 additions and 0 deletions

View File

@ -368,6 +368,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"
})
refute_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
})
refute_equal "http://example.com//", filter.absolute_url(page_url)
end
should "normalize international URLs" do
page_url = ""
filter = make_filter_mock({