-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
7 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,7 +129,8 @@ | |
kirjaamo-email (pgq/take email-q) | ||
exam-date (base/two-weeks-ago)] | ||
(testing "Emails are sent to customer and kirjaamo after successful payment" | ||
(is (= {:recipients ["[email protected]"] | ||
(is (= {:recipients [{:email "[email protected]" | ||
:name "Anne Marie Jones"}] | ||
:subject (str/join ", " ["Yleiset kielitutkinnot (YKI), tarkistusarviointipyyntö: Suomi perustaso" (format-date-string-to-finnish-format exam-date)])} | ||
(select-keys customer-email [:recipients :subject]))) | ||
(testing "Customer email has PDF receipt as attachment" | ||
|
@@ -140,7 +141,7 @@ | |
(is (= (without-empty-lines (:data receipt-attachment)) | ||
(without-empty-lines (parser/render-file "evaluation_payment_receipt_template.html" {:current_date (t/now) | ||
:exam_date exam-date})))))) | ||
(is (= {:recipients ["[email protected]"] | ||
(is (= {:recipients [{:email "[email protected]"}] | ||
:subject (str/join ", " ["YKI" "Suomi perustaso" (format-date-string-to-finnish-format exam-date)])} | ||
(select-keys kirjaamo-email [:recipients :subject]))))) | ||
(testing "Once payment is marked as PAID, later callback invocations do not change the status" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,7 @@ | |
(is (= (:status response) 200)) | ||
(testing "email send request should be send to job queue" | ||
(is (= (:subject email-request) "Ilmoittautuminen (YKI): Suomi perustaso - Omenia, 27.1.2018")) | ||
(is (= (:recipients email-request) ["[email protected]"]))))) | ||
(is (= (:recipients email-request) [{:email "[email protected]"}]))))) | ||
(testing "login link should not be created if exam session isn't open for registration" | ||
(base/execute! "UPDATE exam_date SET registration_start_date='2039-01-01' WHERE id IN (SELECT exam_date_id FROM exam_session WHERE id=1);") | ||
(let [request-data {:email "[email protected]" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,9 @@ | |
(send-exam-registration-completed-email! email-q pdf-renderer "fi" registration-data payment-data) | ||
(let [{:keys [recipients attachments]} (pgq/take email-q)] | ||
(testing "Confirmation email is sent to correct recipient" | ||
(is (= ["[email protected]"] recipients))) | ||
(is (= [{:email "[email protected]" | ||
:name "Teijo Antero Testitapaus"}] | ||
recipients))) | ||
(testing "Attachments contains a PDF receipt" | ||
(is (= 1 (count attachments))) | ||
(let [attachment-data (first attachments) | ||
|