Skip to content

Instantly share code, notes, and snippets.

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