transaction.feature 1023 B

12345678910111213141516171819202122232425
  1. Feature: Transactions
  2. Scenario: User deposit funds and it confirms, then performs a transaction
  3. Given a pending deposit @tx1 of 10000 USD/2 for @account1
  4. And update @tx1 set status to settled
  5. Then @account1 has balance of 10000 USD/2
  6. Given a new transaction
  7. And spend 1000 USD/2 from @account1
  8. And receive 1000 USD/2 in @account2
  9. When commit transaction @tx2 as settled
  10. Then @account1 has balance of 9000 USD/2
  11. Then @account2 has balance of 1000 USD/2
  12. Scenario: User deposit funds and transfer to other accounts
  13. Given a pending deposit @tx1 of 10000 USD/2 for @account1
  14. And update @tx1 set status to settled
  15. Then @account1 has balance of 10000 USD/2
  16. Given a new transaction
  17. And spend 1000 USD/2 from @account1
  18. And receive 999 USD/2 in @account2
  19. And receive 1 USD/2 in @account3
  20. When commit transaction @tx2 as settled
  21. Then @account1 has balance of 9000 USD/2
  22. Then @account2 has balance of 999 USD/2
  23. Then @account3 has balance of 1 USD/2