|
@@ -329,14 +329,15 @@ class AgentTicketAttachmentTest < TestCase
|
|
|
# First test the attachment uploading for new tickets
|
|
|
file_upload(
|
|
|
css: '.content.active .attachmentPlaceholder-inputHolder input',
|
|
|
- files: [Rails.root.join('test', 'data', 'upload', 'upload2.jpg')],
|
|
|
+ files: [large_file],
|
|
|
no_sleep: true,
|
|
|
)
|
|
|
exists(
|
|
|
css: '.content.active .js-submit:disabled',
|
|
|
)
|
|
|
watch_for_disappear(
|
|
|
- css: '.content.active .js-submit:disabled',
|
|
|
+ css: '.content.active .js-submit:disabled',
|
|
|
+ timeout: 4.minutes,
|
|
|
)
|
|
|
exists(
|
|
|
css: '.content.active .js-submit',
|
|
@@ -355,14 +356,23 @@ class AgentTicketAttachmentTest < TestCase
|
|
|
)
|
|
|
file_upload(
|
|
|
css: '.content.active .attachmentPlaceholder-inputHolder input',
|
|
|
- files: [Rails.root.join('test', 'data', 'upload', 'upload2.jpg')],
|
|
|
+ files: [large_file],
|
|
|
no_sleep: true,
|
|
|
)
|
|
|
exists(
|
|
|
css: '.content.active .js-submit:disabled',
|
|
|
)
|
|
|
watch_for_disappear(
|
|
|
- css: '.content.active .js-submit:disabled',
|
|
|
+ css: '.content.active .js-submit:disabled',
|
|
|
+ timeout: 4.minutes,
|
|
|
)
|
|
|
end
|
|
|
+
|
|
|
+ def large_file
|
|
|
+ file = Tempfile.new
|
|
|
+ file.binmode
|
|
|
+ file.write(SecureRandom.random_bytes(6.megabyte))
|
|
|
+ file.close
|
|
|
+ file.path
|
|
|
+ end
|
|
|
end
|