Skip to content

Instantly share code, notes, and snippets.

@brian428
Created September 26, 2012 05:13
Show Gist options
  • Save brian428/3786225 to your computer and use it in GitHub Desktop.
Save brian428/3786225 to your computer and use it in GitHub Desktop.
SpyOn_toHaveBeenCalledWith.coffee
it "should pass the selected company when setting the current company", ->
store = Deft.ioc.Injector.resolve( "companyStore" )
waitsFor( ( -> store.getCount() > 0 ), "Store data never loaded.", 2000 )
runs( ->
grid = viewController.getCompanyGridPanel()
spyOn( viewController, 'setCurrentCompany')
firstCompany = grid.store.getAt( 0 )
grid.fireEvent( "selectionchange", {}, [ firstCompany ], 0 )
expect( viewController.setCurrentCompany ).toHaveBeenCalledWith( firstCompany )
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment