Extract method to create a task in specs