Skip to content

Instantly share code, notes, and snippets.

@shargoj
Created July 28, 2014 15:04
Show Gist options
  • Save shargoj/2d6d25c259a77762d784 to your computer and use it in GitHub Desktop.
Save shargoj/2d6d25c259a77762d784 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/val1 entity)))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment