                    client-details (cl-client/register-client "MYAPP" "myapp.com")
                    access-token (cl-token/create-token client-details user)
                    csrf-token "CSRF-TOKEN"
-                   request (-> (r/request :post "/authorisation")
-                               (assoc :params {:client_id (:client-id client-details) :response_type "code" :redirect_uri "callback" :csrf-token csrf-token})
+                   request (-> (create-request :post (routes/path :authorise)
+                                               {:client_id (:client-id client-details) :response_type "code"
+                                                :redirect_uri "callback" :csrf-token csrf-token})
                                (assoc-in [:session :access_token] (:token access-token))
                                (assoc-in [:session :csrf-token] csrf-token)
                                (assoc :content-type "application/x-www-form-urlencoded") ;To mock a form post

(facts "about authorisation end-point"
       (fact "request with client-id, response_type and redirect_uri returns redirect to login page if there is no user session"
             (let [client-details (cl-client/register-client "ClientTestApp" "localhost:3001") ;FORMAT => {:client-secret "XLFCQRKJXSV3T6YQJL5ZJJVGFUJNT6LD", :client-id "RXBX6ZXAER5KPDSZ3ZCZJDOBS27FLDE7", :name "ClientTestApp", :url "localhost:3001"}
                   request (-> (r/request :get "/authorisation" {:client_id (:client-id client-details) :response_type "code" :redirect_uri "callback"})
                               (assoc :params {:client_id (:client-id client-details) :response_type "code" :redirect_uri "callback"})
                               (r/header "accept" "text/html"))
                   response (oauth/authorise request)]
               (:status response) => 302

                   client-details (cl-client/register-client "MYAPP" "myapp.com")
                   updated-user (user/add-authorised-client-for-user! user-email (:client-id client-details))
                   access-token (cl-token/create-token client-details user)
                   request (-> (create-request :get (routes/path :authorise)
                                               {:client_id (:client-id client-details) :response_type "code"
                                                :redirect_uri "callback"})
                               (assoc-in [:session :access_token] (:token access-token))
                               (assoc-in [:session :user-login] (:login user)))
                   response (oauth/authorise request)]
