Finding images with Capybara

Hi Chris,

this line works:

expect(page).to have_xpath("//img[contains(@src,'environ-peeling-kuur.jpg')]")

thanks for your suggestion, this is indead a lot cleaner then:

have_xpath("//img[@src='/Users/acandael/Sites/beautysalonapp2/spec/support/uploads/promotion/image/#{promotion.id}/environ-peeling-kuur.jpg']")

to make the file name of the image dynamic in my test, I use:

      expect(page).to have_xpath("//img[contains(@src,'#{File.basename(promotion.image.url)}')]")

greetings,

Anthony