From 97ed5a7c57722255fa61edeeef8bbe833e4af042 Mon Sep 17 00:00:00 2001 From: Nikita Ivanov <51688199+ViChyavIn@users.noreply.github.com> Date: Mon, 14 Dec 2020 15:24:50 +0500 Subject: [PATCH] Add tests to the ? in page name fix (#1641) --- test/test_page_view.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/test_page_view.rb b/test/test_page_view.rb index 9cf3c239..a49f9b05 100644 --- a/test/test_page_view.rb +++ b/test/test_page_view.rb @@ -12,7 +12,7 @@ context "Precious::Views::Page" do teardown do FileUtils.rm_rf(@path) end - + test 'guard against malicious filenames' do malicious_title = '' @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 assert_equal @view.breadcrumb, '' end + + test "links to pages containing ?" do + @view = Precious::Views::Page.new + assert_equal @view.page_route("Page?"), '/Page%3F' + end end