Appendix 2Using RSpec with Rails

Throughout this book, we’ve barely mentioned Rails, even though it’s the most popular Ruby framework. This lack of emphasis is intentional. We find that if your testing fundamentals are solid and if you know how to use RSpec in a non-Rails context, it’s easy to apply that knowledge to a Rails app—but not the inverse. In short, everything we’ve covered in this book applies to Rails apps.

With that said, we’d like to show you a few conveniences RSpec offers for testing Rails applications. In this appendix, we’re going to show you how to configure a Rails app for testing with RSpec. We’ve also prepared some cheat sheets cataloging the features provided for working with Rails apps.

For more detailed Rails-specific ...

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.