RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

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

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in