 
       waitsFor waitFn, 'returned endpoint to be correct', 1000
 
-   xit 'should be able to edit an endpoint through PUT', ->
+   it 'should be able to edit an endpoint through PUT', ->
       id = 2
       endpoint = ce.clone endpointData[id-1]
-      context.url = "/#{id}"
 
-      endpoint.request.url = '/munchkin'
-      context.method = 'put'
-      context.post = JSON.stringify endpoint
+      runs ->
+         context.url = "/#{id}"
 
-      createRequest context
-      waitsFor (-> context.finished), 'put request to finish', 1000
+         endpoint.request.url = '/munchkin'
+         context.method = 'put'
+         context.post = JSON.stringify endpoint
 
-      endpoint.id = id
-      context.finished = false
-      context.method = 'get'
+         createRequest context
+         waitsFor (-> context.finished), 'put request to finish', 1000
 
-      createRequest context
-
-      waitFn = ->
-         return false unless context.finished
-         returned = JSON.parse context.body
-         return returned.url is endpoint.url
-
-      waitsFor waitFn, 'get request to finish', 1000
-   it 'should be about to create an endpoint through POST', ->
       runs ->
-         @endpoint = 
-            request:
-               url: '/posted/endpoint'
-            response:
-               status: 200
-         context.url = '/'
-         context.method = 'post'
-         context.post = JSON.stringify @endpoint
+         endpoint.id = id
+         context.finished = false
+         context.method = 'get'
 
          createRequest context
 
          waitFn = ->
             return false unless context.finished
-            return true
+            returned = JSON.parse context.body
+            return returned.request.url is endpoint.request.url
+
+         waitsFor waitFn, 'get request to finish', 1000
+
+   it 'should be about to create an endpoint through POST', ->
+      endpoint = 
+         request:
+            url: '/posted/endpoint'
+         response:
+            status: 200
+
+      runs ->
+         context.url = '/'
+         context.method = 'post'
+         context.post = JSON.stringify endpoint
+
+         createRequest context
+
+         waitFn = ->
+            return false unless context.finished
+            return context.status is 201
          waitsFor waitFn, 'post request to finish', 1000
 
       runs ->

         waitFn = ->
            return false unless context.finished
            returned = JSON.parse context.body
            return returned.request.url is @endpoint.request.url

         waitsFor waitFn, 'get request to return', 1000

      sut.stop -> stopped = true
      waitsFor (-> stopped), 'stubby to stop', 1

   it 'should be able to retreive an endpoint through GET', ->
      id = 3
      endpoint = ce.clone endpointData[id-1]
      endpoint.id = id
