From 849c081a1b601a39078de2d4d458ca0be7d35d8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Thu, 7 Nov 2019 15:58:24 +0100 Subject: [PATCH] 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. --- spec/shared/features/nested_documentable.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/spec/shared/features/nested_documentable.rb b/spec/shared/features/nested_documentable.rb index ca45192a7..9ac59864c 100644 --- a/spec/shared/features/nested_documentable.rb +++ b/spec/shared/features/nested_documentable.rb @@ -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