integration-tests
Josha von Gizycki 6 years ago
parent 70d546749c
commit 2beac8fc47

@ -17,8 +17,8 @@
(-> (redirect (path :home)) (-> (redirect (path :home))
(assoc-in [:session :ident] uname) (assoc-in [:session :ident] uname)
(assoc-in [:session :uuid] (:uuid unode))) (assoc-in [:session :uuid] (:uuid unode)))
(-> (redirect (path :auth-login)) (assoc (redirect (path :auth-login))
(assoc :flash :invalid-credentials))))) :flash :invalid-credentials))))
(defn login! [req] (defn login! [req]
(view/layout! (view/layout!
@ -40,5 +40,5 @@
(defroutes routes (defroutes routes
(GET (register! :auth-login "/login") [] login!) (GET (register! :auth-login "/login") [] login!)
(POST (register! :auth-login-check "/login-check") [] login-check!) (POST (register! :auth-login-check "/login-check") [] login-check!)
(GET (register! :auth-logout "/logout") [] (-> (redirect "/login") (GET (register! :auth-logout "/logout") [] (assoc (redirect "/login")
(assoc :session nil)))) :session nil)))

@ -10,12 +10,12 @@
duplicates (->> (attr-domain/find-by-schema! schema-uuid) duplicates (->> (attr-domain/find-by-schema! schema-uuid)
(map #(if (or (and (empty? attr-uuid) (map #(if (or (and (empty? attr-uuid)
(= name (:name %))) (= name (:name %)))
(and (not (empty? attr-uuid)) (and (seq attr-uuid)
(= name (:name %)) (= name (:name %))
(not= attr-uuid (:uuid %)))) (not= attr-uuid (:uuid %))))
1 0)) 1 0))
(apply +))] (apply +))]
(= 0 duplicates))) (zero? duplicates)))
(spec/def ::unique-attr-name-per-schema (spec/def ::unique-attr-name-per-schema
unique-attr-name-in-schema!) unique-attr-name-in-schema!)

Loading…
Cancel
Save