Setting Up Cypress, Rails, and CircleCI

19-Nov-2020 1989

Recently I set up a Rails app with Cypress end-to-end specs on CircleCI. Capybara's the Rails default for this, but Cypress is better. It's faster, more stable, and its in-browser spec runner is a much better experience than writing specs in Capybara. However, Cypress support is still a bit immature, so you have to do some manual tweaking.

Let Capybara Wander Off To Nibble Grass

In 2016, I argued that Rails projects should abandon the asset pipeline in favor of Webpack. The asset pipeline's still supported for legacy reasons, but Rails did begin integrating Webpack a few months later. Capybara's in the same position; even though Rails is still great overall, a Node.js tool has gotten so much better than its Ruby equivalent that you should just use the Node option at this point. I said "let the asset pipeline die" back in the day, but that feels too strident, so I'm recommending instead that we let Capybara wander off to nibble grass.

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