9f1407b6d7
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). |
||
---|---|---|
.. | ||
administrateur_usage_statistics_service_spec.rb | ||
api_entreprise_service_spec.rb | ||
bill_signature_service_spec.rb | ||
clamav_service_spec.rb | ||
commentaire_service_spec.rb | ||
dossier_search_service_spec.rb | ||
expired_dossiers_deletion_service_spec.rb | ||
france_connect_service_spec.rb | ||
geojson_service_spec.rb | ||
ip_service_spec.rb | ||
notification_service_spec.rb | ||
procedure_export_service_spec.rb | ||
render_partial_service_spec.rb |