As for testing: backlinks in integration tests, Iโm first on the dead page, which, I think, is unlikely to ever be used as a link, and then on the page I'm testing. So my code is as follows
before(:each) do visit deadend_path visit testpage_path end it "testpage Page should have a Back button going :back" do response.should have_selector("a",:href => deadend_path, :content => "Back") end
However, this has a drawback which, if the link really refers to deadend_path, then the test will fail by mistake.
Obromios May 23 '12 at 23:42 2012-05-23 23:42
source share