diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2018-04-01 16:49:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-01 16:49:51 +0200 |
commit | 4b54d2a2a23a3b7b717a89019f6a066fb8da3641 (patch) | |
tree | 1cf8ea8f9a74dc9b9c1202ee3fface3edee0522b /actionview/test | |
parent | 2c56d6324b224f3782c4da5e7ffae528293b09aa (diff) | |
parent | 48e44edfd0a8a7a29aa8fad39638ac0ee5243f42 (diff) | |
download | rails-4b54d2a2a23a3b7b717a89019f6a066fb8da3641.tar.gz rails-4b54d2a2a23a3b7b717a89019f6a066fb8da3641.tar.bz2 rails-4b54d2a2a23a3b7b717a89019f6a066fb8da3641.zip |
Merge pull request #32287 from razh/fix-rails-ujs-html-content
Pass HTML responses as plain-text in rails-ujs
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 5932195363..8a88471982 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 content should be plain-text', 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 === '<p>hello</ps>', 'returned data should be a plain-text string') + }) +}) + asyncTest('XML document should be parsed', 1, function() { buildForm({ method: 'post', 'data-type': 'html' }) |