Simplify the way we attach documents in tests
Now we do it the same way we attach images in `nested_imageable`. Now we don't need to execute some JavaScript in the test, which by the way was causing an error when upgrading to jQuery 3.
This commit is contained in:
@@ -316,9 +316,7 @@ def documentable_attach_new_file(path, success = true)
|
||||
|
||||
document = all("#new_document").last
|
||||
document_input = document.find("input[type=file]", visible: false)
|
||||
page.execute_script("$('##{document_input[:id]}').css('display','block')")
|
||||
attach_file(document_input[:id], path, visible: true)
|
||||
page.execute_script("$('##{document_input[:id]}').css('display','none')")
|
||||
attach_file(document_input[:id], path, make_visible: true)
|
||||
|
||||
within document do
|
||||
if success
|
||||
|
||||
Reference in New Issue
Block a user