Skip to content

Instantly share code, notes, and snippets.

@masonforest
Created December 6, 2012 17:42
Show Gist options
  • Save masonforest/4226421 to your computer and use it in GitHub Desktop.
Save masonforest/4226421 to your computer and use it in GitHub Desktop.
jQuery spies
describe "Quickpay.startQuickPay", ->
it "calls animate on .single_item_quick_pay", ->
quickPay = new Threadflip.QuickPay()
event = new jQuery.Event("click")
animateSpy = spyOn($.fn, "animate")
quickPay.startQuickPay(event)
expect($.fn.animate).toHaveBeenCalledWith({height: "300px"})
expect(animateSpy.mostRecentCall.object.selector).toEqual('.single_item_quick_pay')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment