[rspec-users] scenarios on production data

Tero Tilus tero at tilus.net
Mon Sep 8 15:30:18 EDT 2008

2008-09-05 16:50, Ashley Moran:
> Every time someone asks me this my answer is always the same...
> Don't.

I think I happen have a case where it would be plausible to run
specs/stories against production data.

I need a sanity checker to detect "data smells" of various magnitude
from (a copy of) our production data.  Not all the fumbles are
detectable at action time using validations.  Not all that needs to be
or has to be allowed is sane or does any good.  Also the app has come
a long way and the validity checking has not always been as good as it
is now, and will most certainly still improve over time.

That would of course be using RSpec for something else than testing,
but would it work?  Would it be kosher?  And most importantly how
would I do that?

  rake db:what?
  rake db:whatelse?
  rake spec:smells

> Trying to run tests against production database risks blurring the
> line between the well specified behaviour of your app and the pile
> of crap users inevitably fill it with.  IMHO.

That's exactly why you should not test against production data.
However, could RSpec be handy tool to build a gadget to point out the

Tero Tilus ## 050 3635 235 ## http://www.tilus.net/koti/tero/

More information about the rspec-users mailing list