This project is archived and is in readonly mode.
Encoded slash is not unencoded in a functional test.
-
mjf
My current workaround is to use an integration test rather than a functional test so the URL can be specified directly. But some special handing for the escaping is still required.
def test_foo
id = "hi/bye" url = url_for({ :controller => 'foo', :id => CGI.escape(id)}) url = CGI.unescape(url) get urlend
This results in FooController being invoked with
params["id"] = "hi/bye"(literal slash). -
Prem Sichanugrist (sikachu)
- State changed from new to wontfix
- Importance changed from to Low
Hi,
I can confirm that the example you provided still returning a fail test case on Rails 3.0.1. However, I think if you navigate to
http://some.domain/foo/hi/byeRails would route it tofoo/hi#bye. There's no way thehi/byewill be parsed as an:id.So, I think I would mark this ticket as
wontfix, and I agree that you should always escape your parameters in the test suit, make it like a real URL request.