Is there a good way to check on existence of images and favicons using rspec and capybara?
I can check on the DOM of favicons and images, but I want to be able to check that those images load as well. Is this possible with rspec and capybara?
describe "check images and favicon" do
before { visit "url/to/check")
it "should have the images" do
page.should have_css('img', text: "image1.jpg")
it "should have the favicon" do
page.should have_xpath("/html/head/link[@href='favicon.ico']"
end
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With