O'Reilly logo

Effective Testing with RSpec 3 by Myron Marston, Ian Dees

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

Your Turn

In this chapter, you implemented the final piece of the app: the storage layer that writes to a real database. You wrote integration specs to test this layer. Because these specs made changes to the same global state (the database), they could interfere with one another. You used RSpec’s random test ordering and --bisect ability to unearth these dependencies. You fixed them with a clean around hook, and kept noisy database transaction code out of your integration specs.

Once your integration specs were passing, you found that your end-to-end specs were also green. You’ve completed the first major piece of a real app.

During this project, you’ve come to know RSpec quite well. You’ve learned how to test individual methods using expectations ...

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