-
-
Save glenjamin/75f8d17abef4db9ca9c7 to your computer and use it in GitHub Desktop.
Is there a nice way to be less nested?
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
(it "can call connect, talking to crunch and storing the temporary token" | |
(mock-request-token "callback-url" "token" "secret" | |
(mock-approval-uri "token" "approval-url" | |
(let [app (fn [req] {:body (auth/connect "callback-url")}) | |
resp ((auth/wrap-auth app @options) @request)] | |
(should= "approval-url" (:body resp)) | |
(should-contain "crunch-temp-auth" (:cookies resp)) | |
(let [cookie (get-in resp [:cookies "crunch-temp-auth"])] | |
(should= "token&secret" (:value cookie)) | |
(should= 300 (:max-age cookie)) | |
(should= true (:http-only cookie))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment