From cc04cd95ac17897ea3e6f48836b12d0b01c9d854 Mon Sep 17 00:00:00 2001 From: Cam Saul <cam@getluckybird.com> Date: Fri, 27 Mar 2015 00:11:40 -0700 Subject: [PATCH] test fix --- .dir-locals.el | 1 + src/metabase/api/common.clj | 3 ++- test/metabase/api/common_test.clj | 24 +++++++++++------------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.dir-locals.el b/.dir-locals.el index 04213dcf357..0bb401a0c28 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -17,6 +17,7 @@ (execute-query 1) (expect 1) (expect-eval-actual-first 1) + (expect-expansion 0) (expect-let 1) (ins 1) (let-400 1) diff --git a/src/metabase/api/common.clj b/src/metabase/api/common.clj index aebe704083b..60d1c2e34cc 100644 --- a/src/metabase/api/common.clj +++ b/src/metabase/api/common.clj @@ -377,7 +377,8 @@ - executes BODY inside a `try-catch` block that handles `ApiExceptions` - automatically calls `wrap-response-if-needed` on the result of BODY - tags function's metadata in a way that subsequent calls to `define-routes` (see below) - will automatically include the function in the generated `defroutes` form." + will automatically include the function in the generated `defroutes` form. + - Generates a super-sophisticated Markdown-formatted docstring" {:arglists '([method route docstr? args annotations-map? & body])} [method route & more] {:pre [(or (string? route) diff --git a/test/metabase/api/common_test.clj b/test/metabase/api/common_test.clj index ca2277c6537..2b215684702 100644 --- a/test/metabase/api/common_test.clj +++ b/test/metabase/api/common_test.clj @@ -142,16 +142,14 @@ ;; replace regex `#"[0-9]+"` with str `"#[0-9]+" so expectations doesn't barf (binding [*auto-parse-types* (update-in *auto-parse-types* [:int :route-param-regex] (partial str "#"))] (expect-expansion - (do - (def GET_:id - (GET ["/:id" :id "#[0-9]+"] [id] - (metabase.api.common.internal/catch-api-exceptions - (metabase.api.common.internal/auto-parse [id] - (metabase.api.common.internal/let-annotated-args - {id Required} - (clojure.core/-> (do (->404 (sel :one Card :id id))) - metabase.api.common.internal/wrap-response-if-needed)))))) - (clojure.core/alter-meta! #'GET_:id clojure.core/assoc :is-endpoint? true)) - (defendpoint GET "/:id" [id] - {id Required} - (->404 (sel :one Card :id id))))) + (def GET_:id + (GET ["/:id" :id "#[0-9]+"] [id] + (metabase.api.common.internal/catch-api-exceptions + (metabase.api.common.internal/auto-parse [id] + (metabase.api.common.internal/let-annotated-args + {id Required} + (clojure.core/-> (do (->404 (sel :one Card :id id))) + metabase.api.common.internal/wrap-response-if-needed)))))) + (defendpoint GET "/:id" [id] + {id Required} + (->404 (sel :one Card :id id))))) -- GitLab