-
Notifications
You must be signed in to change notification settings - Fork 47
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
1 parent
251579f
commit 5fe4dd9
Showing
2 changed files
with
33 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package courier | ||
|
||
import scala.concurrent.Await | ||
import scala.concurrent.ExecutionContext.Implicits.global | ||
import scala.concurrent.duration._ | ||
|
||
|
||
class MailSpec extends munit.FunSuite { | ||
test("the mailer should send an email") { | ||
assume(sys.env("CI").isEmpty(), "This test is meant to be ran locally.") | ||
val email = sys.env("IT_EMAIL") | ||
val password = sys.env("IT_PASSWORD") | ||
val mailer = Mailer("smtp.gmail.com", 587) | ||
.auth(true) | ||
.as(email, password) | ||
.startTls(true)() | ||
val mId = Await.result(mailer(Envelope.from(email.addr) | ||
.to(email.addr) | ||
.subject("miss you") | ||
.content(Text("hi mom"))), 10.seconds) | ||
assert(mId.nonEmpty, "Message-ID should be set by the Transport.send call") | ||
} | ||
} |