(defn app-routes [config]
(handler/site
(routes
(GET "/hello/:name" [name :as request]
(fail-> request
(re/validate! :headers-contain "mock_authorization")
(resp/get-header "mock_authorization")
(say-hello name config))))))
(defonce candela nil)
(defn go []
(alter-var-root #'candela
(constantly (jetty/run-jetty (cweb/app config)))))
(defn stop []
(.stop candela))
(defn reset []
(stop)
(repl/refresh :after 'user/go))
(-> (session ring-app)
(visit "/")
(follow "login")
(fill-in "User:" "username")
(fill-in "Password:" "password")
(press "Login")
(follow-redirect)
(has (missing? [:#no-such-element])
"User shouldn't see the no-such-element"))
(-> (ida-session (combined-handler)
(visit "http://wands.gov.uk/register")
(helpers/sign-in)
(follow "Delegate your authority")
(visit "http://wands.gov.uk/persist-delegation"
:request-method :post)
(follow-redirect) ; to Identity Provider
(press "Continue")
(follow-redirect) ; back to service
(check-response
(should-redirect-to
"http://wands.gov.uk/"))))
(defn combined-handler []
(let [apps {"idp.com" michie/handler
"orch.gov.uk" knox/handler
"wands.gov.uk" candela/handler
"orgs.gov.uk" al-kindi/handler
"agents.gov.uk" wheatstone/handler}]
(fn [req]
(let [app (get apps (:server-name req)
default-handler)]
(app req)))))
Source: http://www.horniman.ac.uk/collections/the-wayne-collection
New York apartment block designed by Rosario Candela
Donald Michie
"the father of Arabic philosophy"
“Remember that a primary goal during the alpha is learning. We might not be ready to make the investment in creating production-ready systems. In particular, that investment might be premature if the team learns they are not solving the right problem.”