Skip to content

Fix uses of shared examples in specs

Vincent Agnano requested to merge fix-uses-of-shared-examples into recette

Created by: n-b

️ Merge #1966 first. It’s not directly related, but it would conflict. The first commit is the same; it’s better to only review the other two commits.

We sometimes used shared_examples wrongly in rspec, along with it_behaves_like. it_behaves_like doesn't support multiple contexts in one call; it needs to be called once for each class. RecurrenceConcernSpec did run the multiple contexte internally, but ExpirationSpec and PhoneNumberValidationSpec only ran the tests for the first class. Additionally ExpirationSpec did fail for PlageOuverture.

Checklist avant review:

  • reparcourir le code rapidement pour voir les problèmes évidents (fichiers touchés inutilement, debug logs qui trainent…).
  • Tester la fonctionnalité sur la review app

Merge request reports