diff options
Diffstat (limited to 'addons/web/static/test/core/widget_tests.js')
| -rw-r--r-- | addons/web/static/test/core/widget_tests.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/addons/web/static/test/core/widget_tests.js b/addons/web/static/test/core/widget_tests.js index c0a0012f931..8988002734b 100644 --- a/addons/web/static/test/core/widget_tests.js +++ b/addons/web/static/test/core/widget_tests.js @@ -377,6 +377,19 @@ QUnit.module('core', {}, function () { done(); }); }); + + QUnit.test("calling _rpc on destroyed widgets", function (assert) { + assert.expect(1); + + var widget = new Widget(); + widget.destroy(); + widget._rpc({route: '/a/route'}).always(function () { + throw Error("Calling _rpc on a destroyed widget should return a " + + "deferred that is never resolved nor rejected"); + }); + assert.ok(true, + "there should be no crash when calling _rpc on a destroyed widget"); + }); }); });
\ No newline at end of file |
