Forum: Ruby on Rails View testing (rspec/selenium) - test if a file link works

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Max W. (Guest)
on 2009-05-19 14:00
I have a 'download' link on one page that causes a zip to be built and
then pushes it back as a file to the browser.  I want to write a test to
verify that it does actually push a zip file back but i can't work out
how - can anyone help?

I'm using rspec and selenium.  The line to click the download link looks
like this:

@browser.wait_for_then_click "//p[@id='zip-download']/a[2]/em"

So i guess i'm looking for something along these lines (i have no idea
of the right syntax):

@browser.element(//file/*.zip).should be_true

Any advice welcome!
This topic is locked and can not be replied to.