Add tests to the ? in page name fix (#1641)
This commit is contained in:
@@ -12,7 +12,7 @@ context "Precious::Views::Page" do
|
|||||||
teardown do
|
teardown do
|
||||||
FileUtils.rm_rf(@path)
|
FileUtils.rm_rf(@path)
|
||||||
end
|
end
|
||||||
|
|
||||||
test 'guard against malicious filenames' do
|
test 'guard against malicious filenames' do
|
||||||
malicious_title = '<img src=x onerror=alert(1) />'
|
malicious_title = '<img src=x onerror=alert(1) />'
|
||||||
@wiki.write_page(malicious_title, :markdown, 'Is Bilbo a hobbit? Why certainly!')
|
@wiki.write_page(malicious_title, :markdown, 'Is Bilbo a hobbit? Why certainly!')
|
||||||
@@ -138,4 +138,9 @@ EOS
|
|||||||
@view.instance_variable_set :@content, page.formatted_data
|
@view.instance_variable_set :@content, page.formatted_data
|
||||||
assert_equal @view.breadcrumb, ''
|
assert_equal @view.breadcrumb, ''
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "links to pages containing ?" do
|
||||||
|
@view = Precious::Views::Page.new
|
||||||
|
assert_equal @view.page_route("Page?"), '/Page%3F'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user