test double slash when input = '/'
This commit is contained in:
parent
b30c499196
commit
894d2a0415
|
@ -368,6 +368,24 @@ class TestFilters < JekyllUnitTest
|
||||||
assert_equal "http://example.com/base", filter.absolute_url(page_url)
|
assert_equal "http://example.com/base", filter.absolute_url(page_url)
|
||||||
end
|
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
|
should "normalize international URLs" do
|
||||||
page_url = ""
|
page_url = ""
|
||||||
filter = make_filter_mock({
|
filter = make_filter_mock({
|
||||||
|
|
Loading…
Reference in New Issue