Skip to content

Instantly share code, notes, and snippets.

@boxxxie
Created December 28, 2012 19:33
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 boxxxie/4401133 to your computer and use it in GitHub Desktop.
Save boxxxie/4401133 to your computer and use it in GitHub Desktop.
(def user-to-add {
:name "sharedadmin"
:email "enginuity@enginuity.com"
:display_name "En Ginuity"
:password "somepass"
})
(def deftest-datomic
(do-template [deftest-name schemas body]
(deftest deftest-name
(ds/start {:schemas schemas})
(binding [*connection* (d/connect *uri*)] body))))
(deftest-datomic add-and-retrieve-user user/schema
(testing "did we actually add a user to the db and can we find them by name?"
(let [added-user (user/add user-to-add)
looked-up-user (user/find-first {:name (:name user-to-add)})]
(is (= added-user looked-up-user)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment