                                                                   rook-handler)
                                                                 'io.aviso.rook-test2))
                                            rook-handler)
-                                         'io.aviso.rook-test)))
-        test-mw2 (is (namespace-handler "/merchant" 'io.aviso.rook-test
+                                         'io.aviso.rook-test))
+                    param-handling)
+        test-mw2 (-> (namespace-handler "/merchant" 'io.aviso.rook-test
                                         (compojure/GET "/test" [] {:body "test!"})
                                         (namespace-handler "/:id/activate" 'io.aviso.rook-test2
-                                                           (namespace-handler "/:key" 'io.aviso.rook-test3))))
-        ]
-    (is (nil? (test-mw (mkrequest :post "/456/activate"))))
-    (is (= {:status 200 :body "limit="} (test-mw (mkrequest :get "/merchant/"))))
-    (is (= {:status 200 :body "id=6789"} (test-mw (mkrequest :get "/merchant/6789"))))
-    (is (= {:body "id=4567&offset=1234"} (test-mw (mkrequest :get "/merchant/4567/activate?offset=1234"))))
-    (is (= {:body "test3,id=4567,key=test_key"} (test-mw (mkrequest :get "/merchant/4567/activate/test_key"))))
-    (is (nil? (test-mw2 (mkrequest :post "/456/activate"))))
-    (is (= {:status 200 :body "limit="} (test-mw2 (mkrequest :get "/merchant/"))))
-    (is (= {:status 200 :body "id=6789"} (test-mw2 (mkrequest :get "/merchant/6789"))))
-    (is (= {:body "id=4567&offset=1234"} (test-mw2 (mkrequest :get "/merchant/4567/activate?offset=1234"))))
-    (is (= {:body "test3,id=4567,key=test_key"} (test-mw2 (mkrequest :get "/merchant/4567/activate/test_key"))))
-    (is (= {:status 200 :headers {} :body "test!"} (test-mw2 (mkrequest :get "/merchant/test"))))))+                                                           (namespace-handler "/:key" 'io.aviso.rook-test3)))
+                     param-handling)]
+    (are [handler method path expected-result]
+      (= expected-result
+         (handler (mock/request method path)))
+
+      test-mw :post "/456/activate" nil
+
+      test-mw :get "/merchant/" {:status 200 :body "limit="}
+
+      test-mw :get "/merchant/6789" {:status 200 :body "id=6789"}
+
+      test-mw :get "/merchant/4567/activate?offset=1234" {:body "id=4567&offset=1234"}
+
+      test-mw :get "/merchant/4567/activate/test_key" {:body "test3,id=4567,key=test_key"}
+
+      test-mw2 :post "/456/activate" nil
+
+      test-mw2 :get "/merchant/" {:status 200 :body "limit="}
+
+      test-mw2 :get "/merchant/6789" {:status 200 :body "id=6789"}
+
+      test-mw2 :get "/merchant/4567/activate?offset=1234" {:body "id=4567&offset=1234"}
+
+      test-mw2 :get "/merchant/4567/activate/test_key" {:body "test3,id=4567,key=test_key"}
+
+      test-mw2 :get "/merchant/test" {:status 200 :headers {} :body "test!"})))
       ",request=" (count request)
       ",meth=" request-method))

(defn mkrequest [method path]
  ((-> identity
       ring.middleware.keyword-params/wrap-keyword-params
       ring.middleware.params/wrap-params)
   (mock/request method path)))

(defn u-show [id]
  (str "!" id "!"))

    (is (= "test$/123/activate" (extract-argument-value 'test4 test-request arg-resolvers2)))))

(deftest nested-context-test
  (let [test-mw (-> (compojure/context "/merchant" []
                                       (namespace-middleware
                                         (compojure/routes
                                           (compojure/context "/:id/activate" []
