From 34fc4dee39413529d3e43676b60b196923873639 Mon Sep 17 00:00:00 2001 From: razh Date: Sun, 17 Mar 2019 14:43:00 -0400 Subject: [PATCH] Add regression test for HTML content in rails-ujs See discussion in #32287 --- actionview/test/ujs/public/test/call-remote.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/actionview/test/ujs/public/test/call-remote.js b/actionview/test/ujs/public/test/call-remote.js index c8813bb82a..0f92007007 100644 --- a/actionview/test/ujs/public/test/call-remote.js +++ b/actionview/test/ujs/public/test/call-remote.js @@ -128,6 +128,17 @@ asyncTest('execution of JS code does not modify current DOM', 1, function() { }) }) +asyncTest('HTML document should be parsed', 1, function() { + buildForm({ method: 'post', 'data-type': 'html' }) + + $('form').append('') + $('form').append('') + + submit(function(e, data, status, xhr) { + ok(data instanceof HTMLDocument, 'returned data should be an HTML document') + }) +}) + asyncTest('XML document should be parsed', 1, function() { buildForm({ method: 'post', 'data-type': 'html' })