From e57967c6c3f1ddce6798a89ce922680cbfbfe802 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 25 Oct 2013 14:30:45 +1100 Subject: [PATCH] better exception when discourse.ajax is called, still need to figure out how to fix it though :) --- test/javascripts/test_helper.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/javascripts/test_helper.js b/test/javascripts/test_helper.js index 40855d3fd16..49522e70ba9 100644 --- a/test/javascripts/test_helper.js +++ b/test/javascripts/test_helper.js @@ -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); };