Add specs for both cases from #1463.