Re: [rspec-users] [RSpec] matcher for href

2009-01-19 Thread Jim Gay
On Jan 19, 2009, at 2:11 PM, James Byrne wrote: Of the several ways available to test for this, what would be the preferred way to see if the following is present in an html document WITHOUT actually following the link? response.should have_tag('a[href=?]','/users/new') I tried this: res

Re: [rspec-users] [RSpec] matcher for href

2009-01-19 Thread Jarkko Laine
On 19.1.2009, at 21.11, James Byrne wrote: Of the several ways available to test for this, what would be the preferred way to see if the following is present in an html document WITHOUT actually following the link? I tried this: response.body.should have_text('href="/users/new"') respons

Re: [rspec-users] [RSpec] matcher for href

2009-01-19 Thread James Byrne
James Byrne wrote: > Of the several ways available to test for this, what would be the > preferred way to see if the following is present in an html document > WITHOUT actually following the link? Apparently this is the correct form: response.body.should have_tag("a[href=/users/new]") -- Pos