Johan Sörensen
2005-Jul-07 11:26 UTC
Routes: *path in dev/production and test mode differs?
Hi,
I have a route which looks like this:
map.connect ''repository/file/*path'',
:controller => ''repository'',
:action => ''view_file''
Browsing it in dev mode logs the following params:
{"action"=>"file",
"controller"=>"repository",
"path"=>["trunk"]}
But in my functional tests it looks like this (using get :view_file,
:path => ["file.txt"] in my test):
{"action"=>"file",
"controller"=>"repository",
"path"=>"file.txt"}
Which causes my functional tests to blow up since I have to turn the
path into a "normal" path, using
@params[:path].join(''/'') (eg.
path/to/file) for another backend I''m using to get the files.
Again, all works fine in development mode since the :path params is an
array, but in test it''s a string. Seems like a bug to me, need to look
more into it, but has anyone else experienced this?
--
http://johansorensen.com
http://theexciter.com