       $("#my-div").trigger("click")
 
 
-    it "Plain Routing", ->
+    it "test", (done)->
+
+      expect(postValue).toEqual("12")
+      expect(actionId).toEqual("my-div")
+      expect(actionClass).toEqual("abc")
+      expect(titleValue).toEqual("abc")
+      expect(errorValue).toEqual("#/error")
+      expect(emptyValue).toEqual(0)
+      expect(nonEmptyValue).toEqual(3)
+      expect(postXValue).toEqual(0)
+      expect(eventCustomValue).toEqual(0)
+      done()
+
+
+  describe "Routing and Controllers for Hash Routing", ->
+    emptyValue = postValue = titleValue = postXValue = staticValue = errorValue = null
+
+    beforeEach (done) ->
       $("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")
-
+        error: (current) -> errorValue = current
+        title: (title) -> titleValue = title
 
       r =
-        "/": () -> expect(arguments.length).toEqual(0)
-        "/post/[0-9]+" : (id) ->
-          expect(arguments.length).toEqual(1)
-          expect(id).toEqual(12)
+        "/": () -> emptyValue = arguments.length
+        "/post/[0-9]+" : (id) -> postValue = id
         "/post/:title" : {controller: Controller, action: "title"}
-        "/post/x/*": () -> expect(arguments.length).toEqual(3)
-        "/static" : () -> expect(arguments.length).toEqual(0)
+        "/post/x/*": () -> postXValue = arguments.length
+        "/static" : () -> staticValue = arguments.length
         404: {controller: Controller, action: "error"}
-
 
       Sirius.Application.run({
         route: r,

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


  describe "Routing and Controllers", ->
    it "Hash Routing", ->
      window.location.hash = ""
      error = null
      Controller =
        error: (current) ->
          error = current
          #expect(current).toEqual("#/error")

        action: (e, id, klass) ->
          expect(id).toEqual("my-div")
          expect(klass).toEqual("abc")

        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"}
        "event:custom" : (e, p0) -> expect(p0).toEqual(0)
        "click #my-div": {controller: Controller, action: "action", data: ["id", "class"]}

      j = new JQueryAdapter()

        links = $("#links a")
        for l in links
          $(l).trigger("click")
        done()
        2800
      )

    it "test", (done) ->
      expect(emptyValue).toEqual(0)
      expect(postValue).toEqual("12")
      expect(titleValue).toEqual("abc")
      expect(errorValue).toEqual("/error")
      expect(postXValue).toEqual(3)
      expect(staticValue).toEqual(0)
      done()







