Avoid duplicating code in test files.
Add missing test.

(...which was tested accidentally in the url tests.)