 
         (context "getting the governance resource"
           (with response (http-request :get "/circles/1234/governance/5678"))
-          (it "should return a 200"
-            (should= 200 (:status @response)))
+          (it-responds-with-status HttpStatus/SC_OK @response)
           (it "should return that an open meeting exists"
             (should-contain "true" (get-in @response
                                            [:headers "Open-Meeting"]))))

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

(def test-server (ref nil))



        (context "getting the governance resource"
          (with response (http-request :get "/circles/1234/governance/5678"))
          (it-responds-with-status HttpStatus/SC_OK @response)
          (it-responds-with-body-containing "{\"agenda\":\"Current closed agenda\"" 
                                            @response))

        (context "putting to the governance resource"
          (with response (http-request :put "/circles/1234/governance/5678"))
          (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-responds-with-status HttpStatus/SC_BAD_REQUEST @response)
          (it-responds-with-body "Agenda is closed." @response))

        (context "getting the agenda endpoint"
          (with response (http-request :get "/circles/1234/governance/5678/agenda"))
          (it-responds-with-status HttpStatus/SC_BAD_REQUEST @response)
          (it-responds-with-body "Agenda is closed." @response))))))

(run-specs)
