From b6a063152fd4820351d89f7fcd1339541909f407 Mon Sep 17 00:00:00 2001 From: benjamin wil Date: Wed, 29 Dec 2021 12:47:49 -0800 Subject: [PATCH] Simplify test I came across this test because it was failing JRuby CI runs. I should emphasize, though, that this test was only failing due do an upstream bug in Nokogiri v1.12.5. When I was reviewing the test, to understand why it was failing at all, I noticed that the assertion was rather obfuscated. Specifically, we were post-processing the entire `response.body` and using that as an expectation. --- test/test_app.rb | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/test/test_app.rb b/test/test_app.rb index 906ec8a8..48836f83 100644 --- a/test/test_app.rb +++ b/test/test_app.rb @@ -39,31 +39,29 @@ context "Frontend" do assert_match /
one\ntwo\nthree\nfour\n<\/code><\/pre>\n/m, last_response.body
   end
 
-  def nfd utf8
-    TwitterCldr::Normalization.normalize(utf8, using: :nfd)
-  end
-  
   test 'mathjax assets are served' do
     get '/gollum/assets/mathjax/MathJax.js'
     assert last_response.ok?
   end
 
   test "UTF-8 headers href preserved" do
-    page = 'utfh1'
-    text = nfd('한글')
+    page_content = <<~TEXT
+      ## 한글
 
-    # don't use h1 or it will be promoted to replace file name
-    # which doesn't generate a normal header link
-    @wiki.write_page(page, :markdown, '## ' + text,
-                     { :name => 'user1', :email => 'user1' });
+      Test page "utfh1" content.
+    TEXT
 
-    get page
-    expected = "

#{text}

" - actual = nfd(last_response.body) + @wiki.write_page('utfh1', + :markdown, + page_content, + {name: 'user1', email: 'user1'}) - assert_match /#{expected}/, actual + get 'utfh1' + expected = "

한글

" + + assert_match /#{expected}/, last_response.body end - + test 'rss feed' do channel_title = <Gollum Wiki Latest Changes