Ask for Help
“What’s the best way to test that a controller (a) renders a partial and (b) passes the partial the right locals?”
Mocking render_template and the locals ends up mocking too much of the request cycle. Ideally, we’d like something like:
response.should render_partial("item", :locals => {:item => assigns[:item]})
“Hpricot breaks with xml elements named
param. Any suggestions?”
Works if we replace Hpricot with Nokogiri, so that may be the way to go.
Interesting Things
- A follow up on the problems using Fixture Scenarios with Rails 2.3.2: The fixture are loading twice, although it’s not clear why. The second run barfs with a syntax error. Perhaps the first run doesn’t properly close the fixture file?
- Raising the timeout fixed issues with S3 uploads over slow connections. It might also be more efficient. The timeout could stop a 90% complete upload, then kick off a retry (the gem has a 3 retry policy), which further clogs the tubes.
Update: The Hpricot problem is with elements named param, not params as I originally stated.
Of interest: _Why is hard to decode, but seems like he’s abdicating to Nokogiri:
http://twitter.com/_why/status/2484099316
July 27, 2009 at 6:18 pm