2
6 Comments

What's the hardest part of testing Rails apps?

When you are building your Rails apps what part of testing gets you hung up the most?

Feature tests? Unit tests? Getting CI working? JavaScript tests?

I'd love to hear where you struggle and help out if possible!

I've been doing Rails for ~7 years and testing for almost a decade.

  1. 1

    Not getting any customers looking at the value prop early enough because of spending too much time testing.

  2. 1

    End to end test are now feasible thank to cypress (and the excellent gem cypress-rails). I think the most difficult part is to know what to test, and how.

    1. 1

      I keep seeing this pop up - how does it compare to something like Capybara? What's the benefit over something tried and true?

      1. 1

        I tried Capybara and completely abandoned it. Capybara works pretty well for pages without JS, which means testing more HTML than functionalities. Capybara+Js is a nightmare to configure, both locally and on CI. Plus configuration could lead to brittle test. Cypress is a lot more robust, extremely easy to debug, agnostic to any JS fw used (or not).

    1. 1

      Ugh, amen! Have framework(s) are you using?

      I've had luck with headless Chrome, Capybara, and a gem that automatically keeps my binaries up to date. There's also some webmock configuration needed.

Trending on Indie Hackers
How I grew a side project to 100k Unique Visitors in 7 days with 0 audience 49 comments Competing with Product Hunt: a month later 33 comments Why do you hate marketing? 28 comments My Top 20 Free Tools That I Use Everyday as an Indie Hacker 14 comments $15k revenues in <4 months as a solopreneur 14 comments Use Your Product 13 comments