test: extract record setup code