Test case for #76

As promised, albeit belated, test case for #76. :D

This one is done without any external library but we should use Sinon.JS or the likes if we have any use of spies elsewhere.