Optimizing spec test code; also adding test to verify the right links correspond to the right pages on the layout