Use full url escaping when required in trace tests
authorAndy Allan <git@gravitystorm.co.uk>
Mon, 10 Sep 2018 01:37:52 +0000 (09:37 +0800)
committerAndy Allan <git@gravitystorm.co.uk>
Mon, 10 Sep 2018 01:37:52 +0000 (09:37 +0800)
test/controllers/traces_controller_test.rb

index 605c47555fa6df496aa3b7bf154d83bdb6dd5a2c..7cfc468b2d9906e4fa47ba9b13bbe72a118b4428 100644 (file)
@@ -1032,8 +1032,8 @@ class TracesControllerTest < ActionController::TestCase
         assert_select "item", :count => traces.length do |items|
           traces.zip(items).each do |trace, item|
             assert_select item, "title", trace.name
-            assert_select item, "link", "http://test.host/user/#{trace.user.display_name.gsub(' ', '%20')}/traces/#{trace.id}"
-            assert_select item, "guid", "http://test.host/user/#{trace.user.display_name.gsub(' ', '%20')}/traces/#{trace.id}"
+            assert_select item, "link", "http://test.host/user/#{ERB::Util.u(trace.user.display_name)}/traces/#{trace.id}"
+            assert_select item, "guid", "http://test.host/user/#{ERB::Util.u(trace.user.display_name)}/traces/#{trace.id}"
             assert_select item, "description"
             # assert_select item, "dc:creator", trace.user.display_name
             assert_select item, "pubDate", trace.timestamp.rfc822