Created
September 6, 2012 04:17
-
-
Save brian428/3651157 to your computer and use it in GitHub Desktop.
Spec involving asynchronous behavior and testing a non-view object
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 "allows store to be filtered", -> | |
# We can test methods on a non-view object, including tests that involve asynchronous activities. | |
# This really doesn't belong in the MainTabPanelTest, but for simplicty I'm including it here. | |
store = Deft.ioc.Injector.resolve( "companyStore" ) | |
waitsFor( ( -> store.getCount() > 0 ), "Store data never loaded.", 2000 ) | |
runs( -> | |
expect( store.filters.length ).toBe( 0 ) | |
store.filterIndustry( "Manufacturing" ) | |
expect( store.filters.length ).toBe( 1 ) | |
store.data.each ( thisCompany ) -> | |
expect( thisCompany.get( "industry" ) ).toEqual( "Manufacturing" ) | |
store.clearFilter() | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment