Enforce correct route ordering, and add a test to verify it