Sarah Mei's blog
Help:
- Testing blocks. If you have a block and you want to spy on the internals as it executes, what do you do? Suggestions were:
- Have each method called internally throw a symbol and check for that.
- Turn it into a proc, and set expectations on that.
- Stub the methods being called internally and set expectations on those.
- pass the block to a spy object.
Other suggestions welcome. The project is using rr, which apparently can't do this last option, though that would be ideal.
- Routes in Rails are case-sensitive? /products/1/edit and /Products/1/edit don't both resolve to the same place (unless you specify in routes.rb). Rumor has it that the RFC for URIs says that the path portion of a URL is case-sensitive, as opposed to the case-insensitive domain name.
If anyone wants to read through that document and confirm...feel free.
Help
- Latest Rails book? One pivot is coming back to Rails after several years away. Recommendations: The Rails Way, Rails Guides, Railscasts.
Interesting
- The on302 callback is a myth! One team discovered that if you set a 302 (redirect) callback for an AJAX call, like in Prototype, the redirect is followed by the browser and the callback is never called. Suggestions: hack the library so that if the response URL doesn't equal the request URL, call the on302. Or do that in your application Javascript.
Help
One team is starting to use Sunspot and is curious about testing strategies. Sunspot provides a method that stubs out the backend, but search blocks aren't executed, so it's hard to test actual searching.
Objective C needs a BDD framework. How does Xcode magically know about OCunit? We need to hook in there to have a usable framework.
Interesting
- Mountain West Ruby Conf was awesome.
