Skip to content

Commit

Permalink
improve test email body
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominion5254 committed Dec 20, 2024
1 parent 432d23b commit e4fdefa
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion core/startos/src/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ pub async fn test_system_smtp(ctx: RpcContext, smtp: SmtpValue) -> Result<(), Er
.from((from.clone(), login.clone()))
.to(vec![(from, login.clone())])
.subject("StartOS Test Email")
.text_body("Email credentials have been successfully setup on your StartOS Server");
.text_body("This is a test emails sent from your StartOS Server");
SmtpClientBuilder::new(server, port)
.implicit_tls(false)
.credentials((login, pass_val))
Expand All @@ -905,6 +905,23 @@ pub async fn test_system_smtp(ctx: RpcContext, smtp: SmtpValue) -> Result<(), Er
}
}

#[tokio::test]
async fn test_system_smtp_integration() -> Result<()> {
// Arrange
let ctx = RpcContext::new();
let smtp = SmtpValue {
server: "smtp.gmail.com".to_string(),
port: 587,
from: "[email protected]".to_string(),
login: "rkaht".to_string(),
password: Some("$E2#Cm9tXLoXrKRUfW6gG&*e".to_string()),
};

let result = test_system_smtp(ctx, smtp).await;
assert!(result.is_ok());
Ok(())
}

#[tokio::test]
#[ignore]
pub async fn test_get_temp() {
Expand Down

0 comments on commit e4fdefa

Please sign in to comment.