View testing (rspec/selenium) - test if a file link works


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!