Getting Active Resource working in Edge Rails
I've wanted to have a look at Active Resource since it was announced, and now I need to look at it for work. It took me a while to get it working, so here is my learning.
Say hi to the new site
So, I've finally shipped a new version of reprocessed.org. It's essentially a prototype -- I did the least possible work to get something up and running, so there's a load of stuff missing (comments, primarily), but hopefully I've got a platform to build the fun and interesting things I've wanted to build but couldn't make Movable Type do (at least, do easily enough).
Introducing ModelMocker
While writing Rails apps, I've written several variants on the 'give me an ActiveRecord instance that can't talk to the DB' theme over the last couple of years while writing tests or specs for an app. The basic pattern is a pretty good one - it guarantees you a certain degree of test isolation for your unit tests or specs, when you need it. And, because you're make specific instances isolated, you can get to the DB if you need to.
- 12.12.2008, 19.58
- File under: Ruby, Rails, Ruby on Rails, RSpec, Mocha, Mock objects, testing, development, ModelMocker, Test-driven development, Behaviour-driven development
Shared templates, context-dependent url_for, and RSpec
I have this Rails app which has a set of shared templates which are used by two actions in different controllers. Each action renders one of three shared templates, dependent on the context. This is all fine, except that I rely on the magic of url_for to generate URLs based on the current controller; and I rely on RSpec's view specs to keep things working and tidy.
Flickrawgh
The flickraw Rubygem is the most wonderful Ruby Flickr API client library IN THE WORLD. It is also dumb, in one important way. And, in another important way, so am I. Yesterday the combination was rather embarassing...