Monthly Archives: October 2011

[rspec] view testing: testing the content_for results

I normally do not do a lot of view specs, but at least I want to make sure that my view renders without errors. And sometimes I really need to make sure that some link is shown or hidden depending on e.g. the role of the user or linked objects. For example, So we check […]

Speeding up rspec tests

We have a large test-suite that runs >2200 examples, that took 900 seconds to complete on my machine. Using a few optimisation techniques I was able to bring this time down to 650secs. Which is still long :) But if I run the tests in parallel it takes me down to 300secs (I have two […]

a guide to doing nested model forms in rails (3.1)

One recurring problem when doing Ruby on Rails development is a nested model form. Nested Model Form: a single form that contains multiple, nested models. For example a project with its tasks. A nested model form will allow you to create or edit, in 1 form, the project and each of its tasks. With the […]

Rethinking your design: slim models, fat presenters?

For me, it started with a tweet from Uncle Bob Martin, saying that if all your domain logic is in your model, or if you put your domain logic inside your models by default, then you are doing it wrong. I think the reasoning behind this is that we should design the domain model before […]