BuoySoftware / guides

Documentation for Buoy Software
2 stars 0 forks source link

Standardize how we do feature specs when supporting parallel versions of features in Rails and React #88

Open Simonpedro opened 1 month ago

Simonpedro commented 1 month ago

So far I've seen three different ways in which we test the Rails implementation of a feature that already exists in React, and it'd be nice if the reach consensus on the preferred approach.

  1. Copying and pasting all "React" specs for Rails, either in the same spec file or in a new one

  2. Iterate two times over [true, false]

  3. Use shared examples and use it twice, with the feature flag enabled and disabled

I think both 2) and 3) are superior to 1) since in 1) there is more risk of missing coverage when copy and pasting the specs. In 2) and 3) any missing coverage becomes more visible, as well as any future changes on the spec (because of new requirements).

A nice side effect of approaches 2) and 3) is that it forces the developer to write specs from the user's point of view, relying more in accessible items like text, labels, legends, etc.

Lastly, I think 3) is superior to 2) since it's possible to run one branch (let's say the Rails one) and not the other.

Simonpedro commented 1 month ago

@dgalarza What you think of this?

tute commented 1 month ago

Reminder we discussed this in Slack here: https://buoy-software.slack.com/archives/CLF46S290/p1710945816631299?thread_ts=1710945105.946749&cid=CLF46S290. Option 2 messes up stacktraces on failures, so 3 is best I think!

arzezak commented 1 month ago

I’m also in favor of option 3.