Skip to content

Commit

Permalink
better exception when discourse.ajax is called, still need to figure …
Browse files Browse the repository at this point in the history
…out how to fix it though :)
  • Loading branch information
SamSaffron committed Oct 25, 2013
1 parent a65407b commit e57967c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/javascripts/test_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ window.assetPath = function() { return null; };

var oldAjax = $.ajax;
$.ajax = function() {
console.error("Discourse.Ajax called in test environment (" + arguments[0] + ")");
try {
this.undef();
} catch(e) {
console.error("Discourse.Ajax called in test environment (" + arguments[0] + ")\n caller: " + e.stack.split("\n").slice(2).join("\n"));
}
return oldAjax.apply(this, arguments);
};

Expand Down

0 comments on commit e57967c

Please sign in to comment.