Skip to main content

Watch: Managing Sample Data with Fixtures and Factories

By Ilya Bodrov-Krukowski

Ruby

Share:

Free JavaScript Book!

Write powerful, clean and maintainable JavaScript.

RRP $11.95

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!

You can find code samples for this screencast on GitHub.

Loading the player…

Ilya Bodrov is personal IT teacher, a senior engineer working at Campaigner LLC, author and teaching assistant at Sitepoint and lecturer at Moscow Aviations Institute. His primary programming languages are Ruby (with Rails) and JavaScript. He enjoys coding, teaching people and learning new things. Ilya also has some Cisco and Microsoft certificates and was working as a tutor in an educational center for a couple of years. In his free time he tweets, writes posts for his website, participates in OpenSource projects, goes in for sports and plays music.

New books out now!

Get practical advice to start your career in programming!


Master complex transitions, transformations and animations in CSS!