Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

Standup 7/27/2009: Testing Partial Locals

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.

  1. Daniel DeLeo says:

    Of interest: _Why is hard to decode, but seems like he’s abdicating to Nokogiri:

Post a Comment

Your Information (Name required. Email address will not be displayed with comment.)

* Copy This Password *

* Type Or Paste Password Here *