negative_balance.feature 914 B

12345678910111213141516171819202122
  1. Feature: Transactions with negative balance
  2. Scenario: User with negative deposit cannot transact
  3. Given a settled deposit @tx1 of 10000 USD/2 for @account1
  4. And a settled deposit @tx2 of -11000 USD/2 for @account1
  5. Then @account1 has balance of -1000 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 @tx2 has failed
  11. Then @account1 has balance of -1000 USD/2
  12. Then @account2 has no balance
  13. Scenario: User with negative deposit cannot withdraw
  14. Given a settled deposit @tx1 of 10000 USD/2 for @account1
  15. And a settled deposit @tx2 of -11000 USD/2 for @account1
  16. And a settled deposit @tx3 of 1.1 BTC/8 for @account1
  17. Then @account1 has balance of -1000 USD/2
  18. Then @account1 has balance of 1.1 BTC/8
  19. Then withdraw from @account1 0.5 BTC/8
  20. Then it fails