You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Several of our tests rely on sequences being reset between examples. So we call FactoryBot.reload in a before(:each). But this interferes with us being able to use create in a before(:all). For example:
We rely on IDs being reset between examples because we use approval tests, and in some cases, object IDs appear in the approval output, and it's not straightforward for us to elide them. So we depend on IDs being generated predictably for each example.
The text was updated successfully, but these errors were encountered:
Problem this feature will solve
Several of our tests rely on
sequence
s being reset between examples. So we callFactoryBot.reload
in abefore(:each)
. But this interferes with us being able to usecreate
in abefore(:all)
. For example:The second call to
create
will attempt to reuse the same ID from the first call.Desired solution
It might be good if we could somehow checkpoint the state of the sequences, then restore to that state before each example:
Alternatives considered
Additional context
We rely on IDs being reset between examples because we use approval tests, and in some cases, object IDs appear in the approval output, and it's not straightforward for us to elide them. So we depend on IDs being generated predictably for each example.
The text was updated successfully, but these errors were encountered: