I was trying to follow this video, which adds some nice tests for
Friend:
http://www.clojurewebdevelopment.com/videos/friend-interactive-form
But Kerodon gives me an error, and points to line 13 of my test code:
ERROR in (anyone-can-view-frontpage) (impl.clj:73)
Uncaught exception, not in assertion.
expected: nil
actual: java.lang.ClassCastException: clojure.lang.LazySeq cannot be
cast to java.lang.String
at kerodon.impl$include_parse.invoke (impl.clj:73)
kerodon.core$visit.doInvoke (core.clj:8)
clojure.lang.RestFn.invoke (RestFn.java:423)
mpdv_clojure.core_test/fn (core_test.clj:13)
But line 13 starts with the first inside line of this function:
(deftest anyone-can-view-frontpage
(-> (session app)
(visit "/")
(has (text? "Hello World"))))
And I think my definition of app is fairly straightforward:
(defroutes app-routes
(ANY "/" request (index request))
(GET "/section/" request (section request))
(GET "/admin" request (friend/authorize #{::admin} (admin request)))
(GET "/login" request (login request))
(friend/logout (GET "/logout" _ (ring.util.response/redirect "/")))
(GET "/ok" request (ok request))
(route/resources "/")
(route/not-found "Page not found"))
(def app
(-> app-routes
(friend/authenticate
{:workflows [(workflows/interactive-form)]
:credential-fn (partial credentials/bcrypt-credential-fn
users)})
handler/site))
Can anyone tell me where I went wrong?
Please note, Friend is working great for this app -- it correctly
protects a page until I supply the correct username/password. The
problem I have here is with Kerodon, not Friend.
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.