Permalink
Browse files

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

  • Loading branch information...
1 parent f4dc605 commit cda8f44e5be64156d264b56c0306b399a39d06d2 @kenrestivo kenrestivo committed Jun 5, 2012
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)))))
+

0 comments on commit cda8f44

Please sign in to comment.