spin: Write tests on templates

Close #761