         2000
       )
       setTimeout(
-        () ->  window.location.hash = ""
+        () ->
+          window.location.hash = ""
+          done()
         2400
       )
 

      $("#my-div").trigger("click")


    it "Plain Routing", ->
      $("body").append("<div id='links'></div>")
      arr = ["/", "/post/12", "/post/abc", "/post/x/a/b/c", "/static", "/error", "/"]
      for a in arr
        $('#links').append($("<a></a>").attr({'href':a}))

      Controller =
        error: (current) ->
          expect(current).toEqual("#/error")

        title: (title) ->
          expect(title).toEqual("abc")


      r =
        "/": () -> expect(arguments.length).toEqual(0)
        "/post/[0-9]+" : (id) ->
          expect(arguments.length).toEqual(1)
          expect(id).toEqual(12)
        "/post/:title" : {controller: Controller, action: "title"}
        "/post/x/*": () -> expect(arguments.length).toEqual(3)
        "/static" : () -> expect(arguments.length).toEqual(0)
        404: {controller: Controller, action: "error"}


      Sirius.Application.run({
        route: r,

      expect(r.args.length).toEqual(0)


  describe "Routing and Controllers for Hash Routing and Event Routing", ->

    postValue = errorValue = actionId = actionClass = titleValue = null
    emptyValue = postXValue = eventCustomValue = nonEmptyValue = null
    beforeEach (done) ->
      window.location.hash = ""
      Controller =
        error: (current) ->
          errorValue = current

        action: (e, id, klass) ->
          actionId = id
          actionClass = klass

        title: (title) ->
          titleValue = "abc"


      r =
        "#/": () -> emptyValue = arguments.length
        "#/post/[0-9]+" : (id) ->
          postValue = id
        "#/post/:title" : {controller: Controller, action: "title"}
        "#/post/x/*": () -> nonEmptyValue = arguments.length
        "#/static" : () -> postXValue = arguments.length
        404: {controller: Controller, action: "error"}
        "event:custom" : (e, p0) -> eventCustomValue = p0
        "click #my-div": {controller: Controller, action: "action", data: ["id", "class"]}

      j = new JQueryAdapter()
