From c113ee2b7c5adb59ea7567b31bdb885762f4044b Mon Sep 17 00:00:00 2001 From: Sarah Mei Date: Wed, 10 Nov 2010 10:54:12 -0700 Subject: [PATCH] Finish specs for AspectEdit#stopDrag. --- spec/javascripts/aspect-edit-spec.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spec/javascripts/aspect-edit-spec.js b/spec/javascripts/aspect-edit-spec.js index cc5b6e25e..9f0841b1d 100644 --- a/spec/javascripts/aspect-edit-spec.js +++ b/spec/javascripts/aspect-edit-spec.js @@ -62,6 +62,7 @@ describe("AspectEdit", function() { spyOn($.fn, "animate"); AspectEdit.animateImage($('.avatar')); expect($.fn.animate).toHaveBeenCalledWith({'height':80, 'width':80, 'opacity':0.8}, 200); + expect($.fn.animate.mostRecentCall.object).toHaveClass("avatar"); }); }); @@ -75,11 +76,12 @@ describe("AspectEdit", function() { }); describe("stopDrag", function() { - xit("animates the image back to smaller size and full opacity", function() { + it("animates the image back to smaller size and full opacity", function() { spyOn($.fn, "animate"); $.proxy(AspectEdit.stopDrag, $('.person.ui-draggable'))(); expect($.fn.animate).toHaveBeenCalledWith({'height':70, 'width':70, 'opacity':1}, 200); - expect($.fn.animate.mostRecentCall.object).toHaveClass("avatar"); + // fadeOut calls animate, apparently, so mostRecentCall isn't the right call + expect($.fn.animate.calls[0].object).toHaveClass("avatar"); }); it("fades out the drag and drop text", function() { spyOn($.fn, "fadeOut");