Skip to content

Instantly share code, notes, and snippets.

@meaganewaller
Last active August 29, 2015 13:57
Show Gist options
  • Save meaganewaller/9796171 to your computer and use it in GitHub Desktop.
Save meaganewaller/9796171 to your computer and use it in GitHub Desktop.
(ns wishes.wishlist-spec
(:require
[wishes.wishlist :refer all]
[speclj.core :refer all]))
(describe "Wishlist"
(with fake-wishlist
{:name "Fake Wishlist"
:description "My Fake Wishlist"})
; a function would go here called something like setup-test-db that would setup our test databases.
(it "associates a token with a new wishlist"
(with-redefs [generate-token (fn [] "footoken")]
(let [wishlist (save @fake-wishlist) ; using the fake-wishlist we defined from line 7
wishlist-key (:key wishlist)]
(should= "footoken" (:token (find-by-key wishlist-key)))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment