Add test for chain.replace_rule()