Compare commits

...

1 Commits

Author SHA1 Message Date
Josha von Gizycki 0166b4491a some unsuccesful integration tests
5 years ago

@ -38,9 +38,10 @@
:exclusions [ring/ring-core :exclusions [ring/ring-core
ring/ring-codec ring/ring-codec
commons-io commons-io
commons-codec]]] commons-codec]]
[joshavg/lein-neo4j "0.6.0-SNAPSHOT"]]
:plugins [;; neo4j db :plugins [;; neo4j db
[joshavg/lein-neo4j "0.5.0"] [joshavg/lein-neo4j "0.6.0-SNAPSHOT"]
;; webserver stuff ;; webserver stuff
[lein-less "1.7.5"] [lein-less "1.7.5"]

@ -14,7 +14,7 @@
#(re-matches #(re-matches
#"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" %)) #"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" %))
(def conn (def ^:dynamic *conn*
(let [env #(or (System/getenv %1) %2) (let [env #(or (System/getenv %1) %2)
port (env "NEO4J_PORT" "7687") port (env "NEO4J_PORT" "7687")
host (env "NEO4J_HOST" "localhost") host (env "NEO4J_HOST" "localhost")
@ -40,7 +40,7 @@
(cljs/join \newline))) (cljs/join \newline)))
(defn exec-query! [qry params] (defn exec-query! [qry params]
(with-open [session (db/get-session @conn)] (with-open [session (db/get-session @*conn*)]
(devmode/send-to-bar (devmode/send-to-bar
(str (butiful-query qry) (str (butiful-query qry)
"<br>---Params---<br>" "<br>---Params---<br>"
@ -52,7 +52,7 @@
(spec/tuple fn? map?))) (spec/tuple fn? map?)))
(defn exec-queries! [& tuples] (defn exec-queries! [& tuples]
{:pre [(spec/assert ::tuple-query-list tuples)]} {:pre [(spec/assert ::tuple-query-list tuples)]}
(db/with-transaction @conn tx (db/with-transaction @*conn* tx
(doseq [tuple tuples] (doseq [tuple tuples]
(let [qry (first tuple) (let [qry (first tuple)
params (second tuple)] params (second tuple)]

@ -0,0 +1,13 @@
(ns wanijo.instance.domain-test
(:require [clojure.test :refer :all]
[leiningen.neo4j :refer [with-test-db]]
[neo4j-clj.core :as db]
[wanijo.instance.domain :as domain]))
(deftest instances-are-created
(with-test-db
"/tmp"
(fn []
(binding [wanijo.framework.neo4j/*conn*
(atom (db/connect "bolt://localhost"))]
(println "jadda")))))
Loading…
Cancel
Save