Things you might not need in your tests

31-Jan-2025 4
No one likes slow and brittle tests, in particular if you’re working a TDD workflow. Often, tests get that way because they’re doing too much. Consider avoiding the following: Using a database Database access imposes many costs on your tests. You need to setup a database, connect to it, clean it between test runs, etc. And then each call to the db is slow. In a typical Rails app, it’s unlikely that you’ll be able to avoid the database entirely, but you can reduce its usage. For instance, let’s consider this model:.
Use coupon code:

RUBYONRAILS

to get 30% discount on our bundle!
Prepare for your next tech interview with our comprehensive collection of programming interview guides. Covering JavaScript, Ruby on Rails, React, and Python, these highly-rated books offer thousands of essential questions and answers to boost your interview success. Buy our 'Ultimate Job Interview Preparation eBook Bundle' featuring 2200+ questions across multiple languages. Ultimate Job Interview Preparation eBook Bundle