From 6c2b64dfa5e1d6f90c74f0f1719e9f11f52de7a4 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Fri, 9 Dec 2011 12:41:35 -0500 Subject: Fix #10967: jQuery.fn.promise returns provided object --- test/unit/queue.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/unit/queue.js') diff --git a/test/unit/queue.js b/test/unit/queue.js index bb2d6ba9e..e6291ffb7 100644 --- a/test/unit/queue.js +++ b/test/unit/queue.js @@ -293,3 +293,13 @@ test("promise()", function() { this.dequeue(); }); }); + +test(".promise(obj)", function() { + expect(2); + + var obj = {}; + var promise = jQuery( "#foo" ).promise( "promise", obj ); + + ok( jQuery.isFunction( promise.promise ), ".promise(type, obj) returns a promise" ); + strictEqual( promise, obj, ".promise(type, obj) returns obj" ); +}); -- cgit v1.2.3