Skip to content

Instantly share code, notes, and snippets.

@swlkr
Last active February 4, 2017 22:04
Show Gist options
  • Save swlkr/0f747af124fa7a6c29581c0bc4ac420a to your computer and use it in GitHub Desktop.
Save swlkr/0f747af124fa7a6c29581c0bc4ac420a to your computer and use it in GitHub Desktop.
create-record-test
(ns proj.records-test
(:require [proj.records :refer :all]
[clojure.test :refer :all]))
(deftest create-record-test
(with-redefs [db/insert-record<! (fn [arg] (assoc arg :id 1))]
(testing "with valid record data"
(let [arg {:content "hello world"}]
(is (= {:id 1 :content "hello world"} (create! arg)))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment