alphagov/whitehall — pull request #73 by floehopper (2012-11-14 23:33:15+00:00)
Title: Avoid exception when org-related admin links appear in govspeak text.

* The change in 2a236d623e391f8e927dd0c767a2e65cb2bdd80e was too naïve.
There are other admin organisation-related paths which it cannot
handle. In particular, people have understandably linked to admin
organisation corporate information pages and admin organisation
document series pages (both their "show" and "edit" versions).

* This commit does not actually fix the re-writing to work how it
probably ought to, but it does avoid raising an
`ActiveRecord::RecordNotFound` exception, which in turn causes the
page to respond with a 404.

* I've taken the liberty of moving the organisation admin link
re-writing test into the test where it's siblings live.

* I've tried to follow similar conventions in
`GovspeakHelperTest#find_organisation_from_uri` as are used in
`GovspeakHelper#find_edition_and_supporting_page_from_uri` to make
things more consistent.