Skip to content

Instantly share code, notes, and snippets.

@aamedina
Last active August 29, 2015 14:01
Show Gist options
  • Select an option

  • Save aamedina/166beb3e7e43cbcfb209 to your computer and use it in GitHub Desktop.

Select an option

Save aamedina/166beb3e7e43cbcfb209 to your computer and use it in GitHub Desktop.
(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