Created
September 26, 2012 05:13
-
-
Save brian428/3786225 to your computer and use it in GitHub Desktop.
SpyOn_toHaveBeenCalledWith.coffee
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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