def attach_file(field_locator, path, content_type = nil)
      locate_field(field_locator, FileField).set(path, content_type)
    end
def attach_file(field_locator, path, content_type = nil)
      locate_field(field_locator, FileField).set(path, content_type)
    end
Verifies that an input file field exists on the current page and sets
 its value to the given +file+, so that the file will be uploaded
 along with the form. An optional <tt>content_type</tt> may be given.

 Example:
   attach_file "Resume", "/path/to/the/resume.txt"
   attach_file "Photo", "/path/to/the/image.png", "image/png"