Created
May 31, 2010 12:12
-
-
Save edgargoncalves/419774 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro with-local-user [& body] | |
`(try (.setUp (test/local-service-test-helper (LocalUserServiceTestConfig.))) | |
~@body | |
(finally | |
(test/tear-down)))) | |
(defn wrap-with-gae-local-user-service | |
"Ring middleware method that wraps an application so that every request will have | |
a user-info map assoc'd to the request under the key :appengine/user-info." | |
[application] | |
(fn [request] | |
(with-local-user (application request)))) | |
(wrap! my-app (:users/with-user-info)) | |
(wrap! my-app (:with-gae-local-user-service)) | |
(defservice my-app) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment