Skip to content

Instantly share code, notes, and snippets.

@shargoj
Created July 28, 2014 15:05
Show Gist options
  • Save shargoj/aa34d2d8c1b3c7b18808 to your computer and use it in GitHub Desktop.
Save shargoj/aa34d2d8c1b3c7b18808 to your computer and use it in GitHub Desktop.
(deftest rested-removed-data-should-reflect-in-db
(with-test-db simple-schema
(let [scm-a (scm {:val1 "name" :val2 123124})
scm-b (scm {:val1 "name"})]
@(db/transact *conn* [(sp->nested-map-for-transaction (db) scm-a)])
@(db/transact *conn* [(sp->nested-map-for-transaction (db) scm-b)])
(let [eid (ffirst (db/q '[:find ?eid :where [?eid :scm/val1 "name"]] (db)))
entity (db/entity (db) eid)]
(is (nil? (:scm/val2 entity)))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment