I’m fairly new to Rspec so apologies if this is a really simple question:
I want to check that there is some link on the page that has a link to a pdf.
Essentially something along the lines of:
rendered.should have_selector :a[href=~/\.pdf/]
but I’m getting the error undefined variable or method href.
Is there someway to do:
attribute.should =~ /regex/
using has_selector should do a substring match for you, so you could always try doing something like this: