Ruby
Article
By Ilya Bodrov-Krukowski

Watch: Managing Sample Data with Fixtures and Factories

By Ilya Bodrov-Krukowski

You’ve set up RSpec for your new Rails project but… what about data?

You can’t write many tests without having some sample data and therefore we need a way to deliver them! However, what would be the optimal solution? Should we type them by hand? Should we generate them somehow?

In this video you are going to learn about two ways of managing sample data: fixtures and factories. Apart from that, you’ll learn about annotate gem to add annotations for models and specs, and faker to easily generate fake data. Testing continues!

--ADVERTISEMENT--

You can find code samples for this screencast on GitHub.

Loading the player…

Recommended
Sponsors
The most important and interesting stories in tech. Straight to your inbox, daily. Get Versioning.
Login or Create Account to Comment
Login Create Account