Created
September 26, 2012 06:58
-
-
Save easierbycode/3786493 to your computer and use it in GitHub Desktop.
jasmine runs and waitsFor
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 "Can use an events hash to wire up view methods to DOM elements.", -> | |
viewElt = undefined | |
runs -> | |
$("#todoList").append todoView.render().el | |
waitsFor (-> | |
viewElt = $("#todoList li input.check").filter(":first") | |
viewElt.length > 0 | |
), 1000, "Expected DOM Elt to exist" | |
runs -> | |
expect(todoView.model.get("done")).toBe false |
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 compile a Simple Freakset", -> | |
@freakset.step "step1", -> | |
@store['steps'].push("step1") | |
@commit() | |
@freakset.step "step2", -> | |
@store['steps'].push("step2") | |
@commit() | |
@freakset.step "step3", -> | |
_.delay ( => | |
@store['steps'].push("step3") | |
@commit() | |
), 200 | |
@set = @freakset.compile { steps: [] } | |
waitsFor -> [email protected]() | |
runs -> | |
expect(@set.store['steps']).toContain("step1") | |
expect(@set.store['steps']).toContain("step2") | |
expect(@set.store['steps']).toContain("step3") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment