Skip to content

Commit

Permalink
add two more tests for removing :session or assigning it to nil
Browse files Browse the repository at this point in the history
  • Loading branch information
kenrestivo committed Jun 5, 2012
1 parent f4dc605 commit cda8f44
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion test/noir/test/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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)))))




Expand Down

0 comments on commit cda8f44

Please sign in to comment.