2019-11-25 12:34:35 +01:00
|
|
|
;; This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
;; License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
;;
|
2022-09-20 23:23:22 +02:00
|
|
|
;; Copyright (c) KALEIDOS INC
|
2019-11-25 12:34:35 +01:00
|
|
|
|
2022-11-08 10:40:19 +01:00
|
|
|
(ns backend-tests.email-sending-test
|
2019-11-25 12:34:35 +01:00
|
|
|
(:require
|
2022-11-08 10:40:19 +01:00
|
|
|
[backend-tests.helpers :as th]
|
2020-08-18 19:26:37 +02:00
|
|
|
[app.db :as db]
|
2023-02-06 12:20:51 +01:00
|
|
|
[app.email :as emails]
|
2022-11-03 10:35:19 +01:00
|
|
|
[clojure.test :as t]
|
|
|
|
[promesa.core :as p]))
|
2019-11-25 12:34:35 +01:00
|
|
|
|
|
|
|
(t/use-fixtures :once th/state-init)
|
|
|
|
(t/use-fixtures :each th/database-reset)
|
|
|
|
|
|
|
|
(t/deftest register-email-rendering
|
2020-08-18 19:26:37 +02:00
|
|
|
(let [result (emails/render emails/register {:to "example@app.io" :name "foo"})]
|
2019-11-25 12:34:35 +01:00
|
|
|
(t/is (map? result))
|
|
|
|
(t/is (contains? result :subject))
|
2020-12-01 17:27:19 +01:00
|
|
|
(t/is (contains? result :body))
|
2019-11-25 12:34:35 +01:00
|
|
|
(t/is (contains? result :to))
|
2020-12-01 17:27:19 +01:00
|
|
|
#_(t/is (contains? result :reply-to))
|
|
|
|
(t/is (vector? (:body result)))))
|