Add test for spend. ref #302