vlado / earthquake-croatia

Code for app hosted on https://www.potres-petrinja.hr/ used for helping people in need during the earthquake crisis in Croatia
15 stars 13 forks source link

Test coverage #111

Closed vlado closed 3 years ago

vlado commented 3 years ago

We all know that our test coverage is not great :) and I think we need to do something with it. It is getting hard to develop new features cause there is no feedback if we broke something.

I suggest we start fixing this by writing just few hight level system test, list ads, new ad, ...

radanskoric commented 3 years ago

I can get that started. The earthquake consequences will stretch for many months and that's long enough for the an investment in tests to pay off.

Do we have any preference for the framework? I usually use RSpec but to keep it simple I'm also ok with sticking to vanilla Rails setup.

vlado commented 3 years ago

I can get that started. The earthquake consequences will stretch for many months and that's long enough for the an investment in tests to pay off.

Great

Do we have any preference for the framework? I usually use RSpec but to keep it simple I'm also ok with sticking to vanilla Rails setup.

I'm also for vanilla Rails and keeping things simple 👍

vfonic commented 3 years ago

I vote for RSpec. And for frontend specs, I'd even recommend Cypress. It's possible to integrate it with Rails backend. There are two actively maintained gems that offer this integration.

But I'm ok with minitest and/or anything else (Capybara, etc.).

radanskoric commented 3 years ago

I had some issues getting js system tests running under Test::Unit. I was probably missing something stupid since for the last 8 years I've been exclusively using RSpec.

Anyway, I switched to the setup I'm used to: Rspec + Capybara and I had it working in 5min since I'm familiar with it so I went with in the MR: https://github.com/vlado/earthquake-croatia/pull/122. :)