Skip to content

Instantly share code, notes, and snippets.

@brian428
Created September 26, 2012 05:14
Show Gist options
  • Save brian428/3786228 to your computer and use it in GitHub Desktop.
Save brian428/3786228 to your computer and use it in GitHub Desktop.
SpyOn_andCallThrough.coffee
it "should store the selected company as 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').andCallThrough()
firstCompany = grid.store.getAt( 0 )
grid.fireEvent( "selectionchange", {}, [ firstCompany ], 0 )
expect( viewController.getCurrentCompany() ).toBe( firstCompany )
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment