(ns pedestal.service-test
  (:require [clojure.test :refer :all]
            [io.pedestal.test :refer :all]
            [io.pedestal.http :as http]
            [pedestal.service :as service]))

(def service
  (::http/service-fn (http/create-servlet service/service)))

(deftest home-page-test
  (is (=
       (:body (response-for service :get "/json"))
       "{\"hello\": \"world\""))
  (is (=
       (:headers (response-for service :get "/json"))
       {"Content-Type" "text/html;charset=UTF-8"
        "Strict-Transport-Security" "max-age=31536000; includeSubdomains"
        "X-Frame-Options" "DENY"
        "X-Content-Type-Options" "nosniff"
        "X-XSS-Protection" "1; mode=block"})))
