I have lots of tests which rely on fixtures being a particular state in
order to pass. For example, one test checks that a User object can have
more than 3 associated ‘Page’ objects at a time. That’s a simple example
I have more complicated tests too. The problem is I sometimes add a
without realising it’ll affect the tests and everything blows up.
I’ve taken to creating the a specific state for each test that needs
i.e. before I assert anything, I’ll create new objects from scratch so I
don’t have to use fixtures. This is fine for simple tests but gets
when I’m testing associations between multiple objects.
Just wondering how other people manage situations like this?