Add test for #679. Closes #679