Skip to content

Instantly share code, notes, and snippets.

@mahemoff
Created May 16, 2017 09:45
Show Gist options
  • Save mahemoff/3447fe2b5daacc7686790abaa0f80a99 to your computer and use it in GitHub Desktop.
Save mahemoff/3447fe2b5daacc7686790abaa0f80a99 to your computer and use it in GitHub Desktop.
Rails needs blank fixtures

Something I noticed after settiing use_transactional_tests = false is that fixture files need to be present even if they don't have any data. An empty yml file means the model will be reset after every test run, i.e. you won't have side effects from creating new instances in a test.

It feels off to see an empty file (or just commented) and keep it in the project, but you need to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment