← Graph

Fixtures over Factories

concept 2 connections

Factories recreate the whole universe for every test, making them slow in large applications with many associations, and cross-references have to be worked around. Fixtures are fast, support cross-references natively, and cover the common case where a plain user or plain object is enough. Bonus: fixtures can be loaded into the development database, so exploratory-testing scenarios can be captured by adding a new fixture and reloading. A gem exists that lets developers use factories like fixtures for those who want both.

category
practice
about
Fixtures over Factories concept
Compares fixtures and factories, recommending fixtures for speed and dev-DB reuse.
recommends
Fixtures over Factories concept
Recommends fixtures over factories for speed and dev-DB reuse.

Provenance

Read by
20 extractions