Search⌘ K
AI Features

Recommendations for Faster Tests

Explore techniques to optimize test speed and efficiency in Rails applications by using workflow and value objects, minimizing database calls, leveraging RSpec profiling, and managing test dependencies for faster test runs.

We'll cover the following...

Performance tips

The topic of Rails’ code structure and the attendant ability to write tests always winds up in a mixture of things everyone should try once, things we do regularly, things we wish we could do regularly, things we don’t do but generally regret not doing, and so on. In that spirit, here are a few recommendations:

  • Our current practice is moving complex transaction logic out of controllers into workflow objects, creating logic out of models and into factory or workflow objects, and (somewhat less often) view logic into presenters. All of ...