diff options
author | razh <razh@users.noreply.github.com> | 2019-03-17 14:43:00 -0400 |
---|---|---|
committer | razh <razh@users.noreply.github.com> | 2019-03-17 14:52:14 -0400 |
commit | 34fc4dee39413529d3e43676b60b196923873639 (patch) | |
tree | 0ca1da9c07a9728017e775b5ea76e3af5c6ae6f1 /actionview/test | |
parent | 2674fe38eb61b152e953a1a122040e119fd9f802 (diff) | |
download | rails-34fc4dee39413529d3e43676b60b196923873639.tar.gz rails-34fc4dee39413529d3e43676b60b196923873639.tar.bz2 rails-34fc4dee39413529d3e43676b60b196923873639.zip |
Add regression test for HTML content in rails-ujs
See discussion in #32287
Diffstat (limited to 'actionview/test')
-rw-r--r-- | actionview/test/ujs/public/test/call-remote.js | 11 |
1 files changed, 11 insertions, 0 deletions
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('<input type="text" name="content_type" value="text/html">') + $('form').append('<input type="text" name="content" value="<p>hello</p>">') + + 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' }) |