Example prototypes
Here's an example you've seen before.
Just as in programming, in testing it's common to want to say "This data is like that data, except..." For example, a second test might have a different :date
parameter. That test cares nothing about the :age
parameter, but :age
must nevertheless be supplied...
But does it have to be mentioned? It shouldn't be, because seeing it again in a new example just obscures the new example's purpose. So a new test can use params_like
instead of params
(line 3):
The changeset
doesn't check the value of age
, which is almost certainly OK: how likely is it that date-handling will affect what we know to be an independent schema field?
If you're unhappy about that, read on!
Last updated
Was this helpful?