[Cucumber][Webrat] Using LinkLocator in cucumber step definitions

I am wanting to specify “Then I should not see a “New item” link” in a
cucumber scenario. Is it possible to use Webrat::Locators.find_link (as
in click_link) in a cucumber step definition? Or is there some reason
why I
shouldn’t assert the absence of a link? I could just use

response.should_not contain(text)

but I want to make sure it’s a link that it’s looking for, as the text
happen to appear elsewhere in the middle of a sentance.


On Tue, Jun 23, 2009 at 5:00 PM, mBread [email protected] wrote:


How about:
response.should_not have_selector(“a”, :content => ‘New item’)

Note this is gmail code and untested :slight_smile: