Skip to content

Instantly share code, notes, and snippets.

@ivan-hilckov
Created July 25, 2012 15:25
Show Gist options
  • Select an option

  • Save ivan-hilckov/3176769 to your computer and use it in GitHub Desktop.

Select an option

Save ivan-hilckov/3176769 to your computer and use it in GitHub Desktop.
route
suite "Elections.Router", ->
setup ->
@router = new Elections.Router( @window = sinon.stub() )
test "gotoUrl with url", ->
url = "route2"
@router.gotoUrl(url)
assert.equal @window.location, url
test "gotoUrl with out url", ->
url = ""
@router.gotoUrl(url)
assert.equal @window.location, "/"
suite "#gotoBack", ->
setup ->
@router = new Elections.Router( @window[ "history" ] = { back: sinon.spy() } )
test "gotoBack", ->
@router.gotoBack()
#@window.history.back.calledOnce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment