   
     (context "when creating and retrieving the created circle"
       (with location (get (json/parse-string 
-                            (:body (http-client/post 
-                                     "http://localhost:3000/circles" 
-                                     {:throw-exceptions false
-                                      :content-type :json
-                                      :body (json/generate-string 
-                                              {:name "Test Circle!"
-                                               :lead-link-name "Bill"
-                                               :lead-link-email "bfinn@example.com"})})))
+                            (:body (http-post-request
+                                     "circles" 
+                                     (json/generate-string 
+                                       {:name "Test Circle!"
+                                        :lead-link-name "Bill"
+                                        :lead-link-email "bfinn@example.com"}))))
                             "location"))
-      (with get-response (http-client/get (str "http://localhost:3000" 
-                                               @location)
-                                      {:throw-exceptions false}))
+      (with get-response (http-get-request @location))
       (it "should return the content that was created" 
           (should= 200 (:status @get-response))
           (should= {"lead-link" {"email" "bfinn@example.com"

            [clj-http.client :as http-client]
            [freefrog.rest :as r]))

(defn should-return-400 [spec-context circle-content response-content]
  (context spec-context
    (with response (http-client/post "http://localhost:3000/circles" 
                                    {:throw-exceptions false
                                     :content-type :json
                                     :body circle-content}))
    (it "should return a bad request"
      (should= 400 (:status @response))
      (should-contain response-content (:body @response)))))


  (context "roles"
    (context "when requesting the list of roles for a non-existent circle"
      (with roles-response (http-get-request "circles/1234/roles"))
        (it "should 404"
          (should= 404 (:status @roles-response))))

    (context "when posting a new role to a non-existent circle"
      (with roles-response (http-post-request 
                             "circles/1234/roles"
                             (json/generate-string {:name "My Role!"})))
        (it "should 400 with a helpful error message"
            (should= 400 (:status @roles-response))
            (should-contain "Circle 1234 does not exist." (:body @roles-response))))

    (context "with a new circle"
      (with circle-location (get (json/parse-string 
                                   (:body (http-post-request
                                            "circles" 
                                             (json/generate-string 
                                                     {:name "Test Circle!"
                                                      :lead-link-name "Bill"
                                                      :lead-link-email "bfinn@example.com"}))))
                                 "location"))

        (context "when requesting the list of roles"
          (with roles-response (http-get-request (str @circle-location "/roles")))
          (it "should return an empty array"
              (should= 200 (:status @roles-response))
              (should= "[]" (:body @roles-response))))

        (context "creating a role"
          (with roles-response (http-post-request
                                 (str @circle-location "/roles")
                                 (json/generate-string 
                                          {:name "My Role!"})))
          (it "should redirect to the location of the newly created resource"
              (should= 303 (:status @roles-response))
              (should-contain "application/json" 
