         (context "putting to the governance resource"
           (with response (http-request :put "/circles/1234/governance/5678"))
           ;(xit "should persist a closed governance log")
-          (it "should return a 204"
-            (should= 204 (:status @response))))
+          (it-responds-with-status HttpStatus/SC_NO_CONTENT @response))
 
         (context "putting to the agenda endpoint"
           (with response (http-request :put 
                                        "/circles/1234/governance/5678/agenda"
                                        {:body "New agenda"}))
 
-          (it "should return a 204"
-            (should= 204 (:status @response))))
+          (it-responds-with-status HttpStatus/SC_NO_CONTENT @response))
 
         (context "getting the agenda endpoint"
           (with response (http-request :get "/circles/1234/governance/5678/agenda"))
-          (it "should return an empty agenda"
-            (should= 200 (:status @response))
+          (it-responds-with-status HttpStatus/SC_OK @response)
+          (it-responds-with-body "Current agenda" @response)
+          (it "should return the contents of the existing, open agenda"
             (should-contain "text/plain" (get-in @response
-                                                 [:headers "Content-Type"]))
-            (should= "Current agenda" (:body @response)))))
+                                                 [:headers "Content-Type"])))))
 
       (context "with an existing closed agenda"
         (around [it]


    (context "requesting the governance endpoint"
      (with response (http-request :get "/circles/1234/governance"))
      (it "should return the entire governance document"
        (should= 200 (:status @response))
        (should= (json/generate-string sample-gov-log) (:body @response))))

    (context "posting to the governance endpoint with an unsupported content-type"
      (with response (http-request :post 
                                   "/circles/1234/governance" 
                                   {:content-type "application/json"}))
      (it "should return a 415"
        (should= 415 (:status @response))))

    (context "posting to the governance endpoint"
      (with response (http-request :post "/circles/1234/governance"))
      (it "should return a 201"
        (should= 201 (:status @response))
        (should= (str host-url "/circles/1234/governance/5678") 
                 (get-location @response))))


            [freefrog.rest :as r]
            [freefrog.persistence :as p])
  (:use [ring.adapter.jetty] [ring.util.codec :only [url-encode]])
  (:import [javax.persistence EntityNotFoundException]
           [org.apache.http HttpStatus]))

(def test-server (ref nil))

