I am using Cucumber / Capybara with Rails 3 and am trying to validate the existence of an image after upload. I\'m not sure how to check the url of the image to validate it.
The solution with Nokogiri should work fine. The only problem is that the Cabybara API is different to Webrat, so instead of response.body, you must use page.body.
But theres an even better way to test for the image with Cabybara :
Then /^I should see the image "(.+)"$/ do |image|
page.should have_xpath("//img[@src=\"/public/images/#{image}\"]")
end