2019-11-25 06:34:35 -05: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 16:23:22 -05:00
|
|
|
;; Copyright (c) KALEIDOS INC
|
2019-11-25 06:34:35 -05:00
|
|
|
|
2022-11-08 04:40:19 -05:00
|
|
|
(ns backend-tests.email-sending-test
|
2019-11-25 06:34:35 -05:00
|
|
|
(:require
|
2022-11-08 04:40:19 -05:00
|
|
|
[backend-tests.helpers :as th]
|
2020-08-18 12:26:37 -05:00
|
|
|
[app.db :as db]
|
|
|
|
[app.emails :as emails]
|
2022-11-03 04:35:19 -05:00
|
|
|
[clojure.test :as t]
|
|
|
|
[promesa.core :as p]))
|
2019-11-25 06:34:35 -05:00
|
|
|
|
|
|
|
(t/use-fixtures :once th/state-init)
|
|
|
|
(t/use-fixtures :each th/database-reset)
|
|
|
|
|
|
|
|
(t/deftest register-email-rendering
|
2020-08-18 12:26:37 -05:00
|
|
|
(let [result (emails/render emails/register {:to "example@app.io" :name "foo"})]
|
2019-11-25 06:34:35 -05:00
|
|
|
(t/is (map? result))
|
|
|
|
(t/is (contains? result :subject))
|
2020-12-01 11:27:19 -05:00
|
|
|
(t/is (contains? result :body))
|
2019-11-25 06:34:35 -05:00
|
|
|
(t/is (contains? result :to))
|
2020-12-01 11:27:19 -05:00
|
|
|
#_(t/is (contains? result :reply-to))
|
|
|
|
(t/is (vector? (:body result)))))
|