Fix the tests

Sinon's API docs are a bit misleading in places and we were using the
wrong methods. Fixed.