demarches-normaliennes/spec/services
Pierre de La Morinerie 9f1407b6d7 expiration: fix the mailer arguments
The mailers expect serializable arguments, but were given
ActiveRecord::Relation objects instead. This made the mailers throw an
exception.

But how was that possible ? This code is tested, and the tests were
green.

Well, the specs spy on the mailer implementation, in order to check that
the mailers methods were properly called. Fair enough.

But if the specs mock the mailer code (instead of calling the original
implementation), we may not notice that the original implementation
rejects our method parameters.

Here this is the case: once we actually call the original implementation
the tests start to fail, because some arguments are not converted from
an ActiveRecord::Relation to a serializable array.

This is fixed by ensuring that the mailer code is executed (and doesn't
throw an exception).
2020-05-18 16:24:08 +02:00
..
administrateur_usage_statistics_service_spec.rb specs: always require rails_helper 2020-03-31 12:48:32 +02:00
api_entreprise_service_spec.rb fix spec with not expired token 2020-05-06 10:57:45 +02:00
bill_signature_service_spec.rb specs: always require rails_helper 2020-03-31 12:48:32 +02:00
clamav_service_spec.rb specs: always require rails_helper 2020-03-31 12:48:32 +02:00
commentaire_service_spec.rb specs: always require rails_helper 2020-03-31 12:48:32 +02:00
dossier_search_service_spec.rb fix flacky test 2020-05-07 10:23:28 +02:00
expired_dossiers_deletion_service_spec.rb expiration: fix the mailer arguments 2020-05-18 16:24:08 +02:00
france_connect_service_spec.rb specs: always require rails_helper 2020-03-31 12:48:32 +02:00
geojson_service_spec.rb Remove quartiers prioritaires 2020-04-14 10:29:59 +02:00
ip_service_spec.rb specs: always require rails_helper 2020-03-31 12:48:32 +02:00
notification_service_spec.rb instructors : receive daily emails for declarative folders 2020-03-17 15:54:50 +01:00
procedure_export_service_spec.rb dossier: remove "Birthdate" column from export 2020-05-18 13:14:28 +00:00
render_partial_service_spec.rb specs: always require rails_helper 2020-03-31 12:48:32 +02:00