         (is (re-seq #"always" (:thought e))))))
   (testing "Passing multiple values uses them as OR"
     ;; The following could also have been passed as "?q=always+money"
-    (let [response (app (-> (request :get "/api/memory/search" {:q "always money"})
-                            (header "Accept" "application/transit+json")))
-          clj-data (transit->clj (:body response))]
+    (let [[response clj-data] (get-request "/api/memory/search" {:q "always money"})]
       (is response)
       (is (= 200 (:status response)))
       (is (= "application/transit+json" (get-in response [:headers "Content-Type"])))

(ns memento.test.routes.api
  (:require [clojure.test :refer :all]
            [cognitect.transit :as transit]
            [ring.mock.request :refer [request header]]
            [memento.handler :refer [app]]
            [memento.test.db.core :as tdb]
            [memento.test.db.memory :as tdm]))


;;;;

  (tdb/init-placeholder-data!)
  (tdm/import-placeholder-memories!)
  (testing "Search request should not include a trailing slash"
    (let [[response _] (get-request "/api/memory/search/?q=")]
      (is response)
      (is (= 404 (:status response)))))
  (testing "GETting just 'memory' returns all thoughts"
    (let [[response clj-data] (get-request "/api/memory" nil)]
      (is response)
      (is (= 200 (:status response)))
      (is (= "application/transit+json" (get-in response [:headers "Content-Type"])))
