From cd5c19e530d369bb7e541664e81440914d9bd9ff Mon Sep 17 00:00:00 2001 From: Jacques Distler Date: Sat, 3 May 2008 19:02:56 -0500 Subject: [PATCH] Routes Make remove_orphaned_pages work in a proxied situation. Also, "fix" a busted functional test. I'm not happy with this one. We're enforcing plain-text titles (which, I think, is the correct thing to do), but sending them as type="html", which then requires double-encoding. --- config/routes.rb | 2 +- test/functional/wiki_controller_test.rb | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index 6ca08c33..6a70ede9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -11,11 +11,11 @@ end ActionController::Routing::Routes.draw do |map| map.connect 'create_system', :controller => 'admin', :action => 'create_system' map.connect 'create_web', :controller => 'admin', :action => 'create_web' - map.connect 'remove_orphaned_pages', :controller => 'admin', :action => 'remove_orphaned_pages' map.connect 'delete_web', :controller => 'admin', :action => 'delete_web' map.connect 'web_list', :controller => 'wiki', :action => 'web_list' connect_to_web map, ':web/edit_web', :controller => 'admin', :action => 'edit_web' + connect_to_web map, ':web/remove_orphaned_pages', :controller => 'admin', :action => 'remove_orphaned_pages' connect_to_web map, ':web/files/:id', :controller => 'file', :action => 'file', :requirements => {:id => /[-._\w]+/}, :id => nil connect_to_web map, ':web/import/:id', :controller => 'file', :action => 'import' connect_to_web map, ':web/login', :controller => 'wiki', :action => 'login' diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb index 19fe3100..ad11007e 100755 --- a/test/functional/wiki_controller_test.rb +++ b/test/functional/wiki_controller_test.rb @@ -525,13 +525,15 @@ class WikiControllerTest < Test::Unit::TestCase def test_atom_title_with_ampersand # was ticket:143 + # Since we're declaring to be of type="html", the content is unescaped once before interpreting. + # Evidently, the desired behaviour is that the final result be HTML-encoded. Hence the double-encoding here. @wiki.write_page('wiki1', 'Title&With&Ampersands', 'About spaces', 1.hour.ago, Author.new('NitPicker', '127.0.0.3'), test_renderer) r = process 'atom_with_headlines', 'web' => 'wiki1' assert r.body.include?('<title type="html">Home Page') - assert r.body.include?('Title&With&Ampersands') + assert r.body.include?('Title&amp;With&amp;Ampersands') end def test_atom_timestamp