Skip to content

Instantly share code, notes, and snippets.

@glenjamin
Created March 22, 2013 00:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glenjamin/75f8d17abef4db9ca9c7 to your computer and use it in GitHub Desktop.
Save glenjamin/75f8d17abef4db9ca9c7 to your computer and use it in GitHub Desktop.
Is there a nice way to be less nested?
(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