Set status code on mock response before writing