O'Reilly logo

Rails 4 Test Prescriptions by Noel Rappin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Fixtures

Rails has always made it very easy to manage a database just for test data, which is automatically cleared between tests. (While there’s no denying this is tremendously useful, it has also lulled all of us into feeling that a test that touches the database—a huge third-party dependency—is somehow a unit test.) One of the most valuable ways in which Ruby on Rails has supported automated testing is through the use of easily created data that is accessible to all the tests in your system, no matter when or where you write those tests, using fixtures specified in a YAML file. (YAML stands for YAML Ain’t Markup Language.)[4] It’s sometimes hard for an experienced Rails programmer to remember just how exciting the YAML fixtures used to seem. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required