DRYing up RSpec controller examples
We DRY up our Ruby code but often don’t stop to think about how DRY applies to RSpec. Most of us have several near-identical controller specs in each Rails application - all of which are just testing CRUD.
In this blog post about shared example groups for controller specs I show one way to cut that down to a much DRYer, more declarative way of expressing how CRUD controllers ought to behave.
Post a comment