Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add two more tests for removing :session or assigning it to nil

  • Loading branch information...
commit cda8f44e5be64156d264b56c0306b399a39d06d2 1 parent f4dc605
@kenrestivo kenrestivo authored
Showing with 12 additions and 1 deletion.
  1. +12 −1 test/noir/test/core.clj
View
13 test/noir/test/core.clj
@@ -346,7 +346,18 @@
#(assoc-in % [:session :foo] "baz"))
base-map))]
(is (= "baz" (:foo part-change)))
- (is (= "auugh" (:quuz part-change)))))))
+ (is (= "auugh" (:quuz part-change)))))
+ ;; delete whole session.
+ ;; ring takes nil to mean delete session, so it must get passed through
+ (is (nil? (:session ((session/noir-session
+ #(assoc % :session nil))
+ base-map))))
+ ;; make sure the whole session goes away and stays away if deleted
+ (is (not (contains? ((session/noir-session
+ #(dissoc % :session))
+ base-map)
+ :session)))))
+
Please sign in to comment.
Something went wrong with that request. Please try again.