1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add regression test for HTML content in rails-ujs

See discussion in #32287
This commit is contained in:
razh 2019-03-17 14:43:00 -04:00
parent 2674fe38eb
commit 34fc4dee39

View file

@ -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' })