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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
73c04e9ef9ca435c5b19a2e765ae6d20?d=identicon&s=25 Max Williams (max-williams)
on 2009-05-19 12: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!
max
This topic is locked and can not be replied to.