I want to check that all links on a page contain a certain element. This is the current web_step I have but it is not working. Any ideas?
Then /^all links above footer should countain "([^"]+)"$/ do |parameter|
al = page.all('a')
al.each do |i|
i.include?(parameter).should be_true
end
end
You probably need to assert against a particular attribute of each
aelement – if you’re checking that the ‘src’ attribute contains ‘parameter’ then:Or, to make better use of the rspec matchers (and get better failure messages):