Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save easierbycode/3786493 to your computer and use it in GitHub Desktop.
Save easierbycode/3786493 to your computer and use it in GitHub Desktop.
jasmine runs and waitsFor
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
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