aboutsummaryrefslogtreecommitdiffstats
path: root/actionview
diff options
context:
space:
mode:
authorWillian Gustavo Veiga <beberveiga@gmail.com>2019-07-26 12:58:22 -0300
committerWillian Gustavo Veiga <willian.veiga@tnh.health>2019-07-26 12:59:23 -0300
commit64631d83c561510579a04ac8317ab644e52ab714 (patch)
tree887ce8658fd7baefd0852d7146195ad77b8919f7 /actionview
parentc3e786fc4822017095b605cabfb5ee55d21389b9 (diff)
downloadrails-64631d83c561510579a04ac8317ab644e52ab714.tar.gz
rails-64631d83c561510579a04ac8317ab644e52ab714.tar.bz2
rails-64631d83c561510579a04ac8317ab644e52ab714.zip
Add test for submitted fields within disabled fieldsets
Diffstat (limited to 'actionview')
-rw-r--r--actionview/test/ujs/public/test/data-remote.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/actionview/test/ujs/public/test/data-remote.js b/actionview/test/ujs/public/test/data-remote.js
index 16ea114f3b..dbbb383995 100644
--- a/actionview/test/ujs/public/test/data-remote.js
+++ b/actionview/test/ujs/public/test/data-remote.js
@@ -490,4 +490,22 @@ asyncTest('changing a select option without "data-url" attribute still fires aja
setTimeout(function() { start() }, 20)
})
+asyncTest('inputs inside disabled fieldset are not submited on remote forms', 3, function() {
+ $('form')
+ .append('<fieldset>\
+ <input name="description" value="A wise man" />\
+ </fieldset>')
+ .append('<fieldset disabled="disabled">\
+ <input name="age" />\
+ </fieldset>')
+ .bindNative('ajax:success', function(e, data, status, xhr) {
+ equal(data.params.user_name, 'john')
+ equal(data.params.description, 'A wise man')
+ equal(data.params.age, undefined)
+
+ start()
+ })
+ .triggerNative('submit')
+})
+
})()