Last active
August 29, 2015 14:01
-
-
Save aamedina/166beb3e7e43cbcfb209 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| (defn mock-suggestions-response | |
| [name] | |
| (go (<! (a/timeout (max (rand-int 300) 100))) | |
| {:status 200 | |
| :body (->> (gen/elements [name]) | |
| (gen/tuple (gen/not-empty gen/string-alpha-numeric)) | |
| (gen/fmap | |
| (fn [[noise name]] | |
| (-> (str "www." (str/lower-case name) noise ".com") | |
| (str/replace #" " "")))) | |
| (gen/sample) | |
| (take 5) | |
| (into []))})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment