Permalink
Browse files

Added test back from bradphilips-master, slightly modified

  • Loading branch information...
1 parent 5b6520f commit 4382f580766fcdd14201c204f43ca5aeb0928501 @JangoSteve JangoSteve committed Aug 16, 2012
Showing with 14 additions and 0 deletions.
  1. +14 −0 test/public/test/call-remote-callbacks.js
@@ -75,6 +75,20 @@ asyncTest('setting data("cross-domain",true) with "ajax:before" uses new setting
});
});
+asyncTest('setting data("with-credentials",true) with "ajax:before" uses new setting in request', 2, function(){
+ $('form[data-remote]').data('with-credentials',false)
+ .live('ajax:before', function() {
+ var form = $(this);
+ form.data('with-credentials',true);
+ });
+
+ submit(function(form) {
+ form.bind('ajax:beforeSend', function(e, xhr, settings) {
+ equal(settings.xhrFields && settings.xhrFields.withCredentials, true, 'setting modified in ajax:before should have forced withCredentials request');
+ });
+ });
+});
+
asyncTest('stopping the "ajax:beforeSend" event aborts the request', 1, function() {
submit(function(form) {
form.bind('ajax:beforeSend', function() {

0 comments on commit 4382f58

Please sign in to comment.