add specs for the chain function