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.
This commit is contained in:
parent
1d5faf4a84
commit
cd5c19e530
|
@ -11,11 +11,11 @@ end
|
||||||
ActionController::Routing::Routes.draw do |map|
|
ActionController::Routing::Routes.draw do |map|
|
||||||
map.connect 'create_system', :controller => 'admin', :action => 'create_system'
|
map.connect 'create_system', :controller => 'admin', :action => 'create_system'
|
||||||
map.connect 'create_web', :controller => 'admin', :action => 'create_web'
|
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 'delete_web', :controller => 'admin', :action => 'delete_web'
|
||||||
map.connect 'web_list', :controller => 'wiki', :action => 'web_list'
|
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/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/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/import/:id', :controller => 'file', :action => 'import'
|
||||||
connect_to_web map, ':web/login', :controller => 'wiki', :action => 'login'
|
connect_to_web map, ':web/login', :controller => 'wiki', :action => 'login'
|
||||||
|
|
|
@ -525,13 +525,15 @@ class WikiControllerTest < Test::Unit::TestCase
|
||||||
|
|
||||||
def test_atom_title_with_ampersand
|
def test_atom_title_with_ampersand
|
||||||
# was ticket:143
|
# was ticket:143
|
||||||
|
# Since we're declaring <title> 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',
|
@wiki.write_page('wiki1', 'Title&With&Ampersands',
|
||||||
'About spaces', 1.hour.ago, Author.new('NitPicker', '127.0.0.3'), test_renderer)
|
'About spaces', 1.hour.ago, Author.new('NitPicker', '127.0.0.3'), test_renderer)
|
||||||
|
|
||||||
r = process 'atom_with_headlines', 'web' => 'wiki1'
|
r = process 'atom_with_headlines', 'web' => 'wiki1'
|
||||||
|
|
||||||
assert r.body.include?('<title type="html">Home Page</title>')
|
assert r.body.include?('<title type="html">Home Page</title>')
|
||||||
assert r.body.include?('<title type="html">Title&With&Ampersands</title>')
|
assert r.body.include?('<title type="html">Title&amp;With&amp;Ampersands</title>')
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_atom_timestamp
|
def test_atom_timestamp
|
||||||
|
|
Loading…
Reference in a new issue