added explicit unit test to verify the link rewriting