response.should have_selector("img.photo", :src => photo_path(@photo))However, it's a lot harder if you want to get access to the img tag, get its src attribute, and test something about that src attribute without hard coding the exact value:
within("img.photo") do |img|
# Using ".dom" is the key.
url = img.dom["src"]
# Now, do more tests against the URL itself.