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 ...

Get Effective Testing with RSpec 3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.