Added test for client graphql
This commit is contained in:
30
test/clj/auto_ap/integration/util.clj
Normal file
30
test/clj/auto_ap/integration/util.clj
Normal file
@@ -0,0 +1,30 @@
|
||||
(ns auto-ap.integration.util
|
||||
(:require
|
||||
[auto-ap.datomic :refer [conn uri]]
|
||||
[clj-time.core :as time]
|
||||
[datomic.api :as dc]
|
||||
[auto-ap.datomic.migrate :as migrate])
|
||||
)
|
||||
|
||||
(defn wrap-setup
|
||||
[f]
|
||||
(with-redefs [auto-ap.datomic/uri "datomic:mem://datomic-transactor:4334/invoice"]
|
||||
(dc/create-database uri)
|
||||
(with-redefs [auto-ap.datomic/conn (dc/connect uri)]
|
||||
(migrate/migrate conn)
|
||||
(f)
|
||||
(dc/delete-database uri))))
|
||||
|
||||
|
||||
(defn admin-token []
|
||||
{:user "TEST ADMIN"
|
||||
:exp (time/plus (time/now) (time/days 1))
|
||||
:user/role "admin"
|
||||
:user/name "TEST ADMIN"})
|
||||
|
||||
(defn user-token []
|
||||
{:user "TEST USER"
|
||||
:exp (time/plus (time/now) (time/days 1))
|
||||
:user/role "user"
|
||||
:user/name "TEST USER"
|
||||
:user/clients [{:db/id 1}]})
|
||||
Reference in New Issue
Block a user