From 16ea7a321bb3115ad0fe5cbbc4c64c36bc4e00a8 Mon Sep 17 00:00:00 2001 From: Sarah Mei Date: Mon, 8 Nov 2010 21:19:49 -0800 Subject: [PATCH] specs for AspectEdit#animateImage --- spec/javascripts/aspect-edit-spec.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/spec/javascripts/aspect-edit-spec.js b/spec/javascripts/aspect-edit-spec.js index ed03777e1..395ac859a 100644 --- a/spec/javascripts/aspect-edit-spec.js +++ b/spec/javascripts/aspect-edit-spec.js @@ -51,6 +51,26 @@ describe("AspectEdit", function() { }); }); + describe("animateImage", function() { + beforeEach(function() { + $('#jasmine_content').html( +'
  • ' + +' Alexander Hamiltom' + +'
  • ' + ); + }); + it("hides the tipsy ... thingy, whatever that is", function() { + spyOn($.fn, "tipsy"); + AspectEdit.animateImage($('.avatar')); + expect($.fn.tipsy).toHaveBeenCalledWith("hide"); + }); + it("animates the image to make it look larger and slightly opaque", function() { + spyOn($.fn, "animate"); + AspectEdit.animateImage($('.avatar')); + expect($.fn.animate).toHaveBeenCalledWith({'height':80, 'width':80, 'opacity':0.8}, 200); + }); + }); + describe("decrementRequestsCounter", function() { describe("when there is one request", function() { it("removes the counter from the new requests div", function() {