diff --git a/sputnikdao-factory2/src/lib.rs b/sputnikdao-factory2/src/lib.rs index bd8ffde63..17a54229a 100644 --- a/sputnikdao-factory2/src/lib.rs +++ b/sputnikdao-factory2/src/lib.rs @@ -401,6 +401,20 @@ mod tests { use super::*; + #[test] + #[should_panic(expected = "ERR_NOT_ENOUGH_DEPOSIT")] + fn test_create_error() { + let mut context = VMContextBuilder::new(); + testing_env!(context + .current_account_id(accounts(0)) + .predecessor_account_id(accounts(0)) + .build()); + let mut factory = SputnikDAOFactory::new(); + + testing_env!(context.attached_deposit(to_yocto("5")).build()); + factory.create("test".parse().unwrap(), "{}".as_bytes().to_vec().into()); + } + #[test] fn test_basics() { let mut context = VMContextBuilder::new(); @@ -410,7 +424,7 @@ mod tests { .build()); let mut factory = SputnikDAOFactory::new(); - testing_env!(context.attached_deposit(to_yocto("10")).build()); + testing_env!(context.attached_deposit(to_yocto("6")).build()); factory.create("test".parse().unwrap(), "{}".as_bytes().to_vec().into()); testing_env!( @@ -422,7 +436,7 @@ mod tests { ); factory.on_create( format!("test.{}", accounts(0)).parse().unwrap(), - U128(to_yocto("10")), + U128(to_yocto("6")), accounts(0), ); assert_eq!(