 
         before (done) ->
             measure = fixtureMeasure.measureMovement2
+            measure.sensorId = store.sensor.id
             @client.post "sensors/#{measure.sensorId}/measures", measure, done
 
         before (done) ->
             measure = fixtureMeasure.measureMovement3
+            measure.sensorId = store.sensor.id
             @client.post "sensors/#{measure.sensorId}/measures", measure, done
 
         it 'should allow requests', (done) ->
-            @client.get "sensors/#{store.rule.id}/measures?from=#{interval.minTime.toISOString()};to=#{interval.maxTime.toISOString()}", done
+            @client.get "sensors/#{store.sensor.id}/measures?from=#{interval.minTime.toISOString()};to=#{interval.maxTime.toISOString()}", done
 
         it 'should reply with the corresponding measures', ->
             expect(@err).to.not.exist
             expect(@response.statusCode).to.equal 200
             expect(@body).to.have.length(2)
-            expect(@body[0].type).to.equal fixtureMeasure.measureMovement1.type
-            expect(@body[0].value).to.equal fixtureMeasure.measureMovement1.value
-            expect(@body[0].time).to.equal fixtureMeasure.measureMovement1.time
-            expect(@body[0].id).to.equal store.measureId
-            expect(@body[1].type).to.equal fixtureMeasure.measureMovement1.type
-            expect(@body[1].value).to.equal fixtureMeasure.measureMovement1.value
-            expect(@body[1].time).to.equal fixtureMeasure.measureMovement1.time
+            expect(@body[0].type).to.equal fixtureMeasure.measureMovement2.type
+            expect(@body[0].value).to.equal fixtureMeasure.measureMovement2.value
+            expect(@body[0].time).to.equal fixtureMeasure.measureMovement2.time.toISOString()
+            expect(@body[1].type).to.equal fixtureMeasure.measureMovement3.type
+            expect(@body[1].value).to.equal fixtureMeasure.measureMovement3.value
+            expect(@body[1].time).to.equal fixtureMeasure.measureMovement3.time.toISOString()
 
     describe 'When we update a measure (PUT /sensors/:sensorId/measures/:id)', ->
 
         it 'should allow requests', (done) ->
-            @client.put "sensors/#{store.rule.id}/measures/#{store.measureId}", fixtureMeasure.updateMeasure, done
+            @client.put "sensors/#{store.sensor.id}/measures/#{store.measureId}", fixtureMeasure.updateMeasure, done
 
         it 'should return an unauthorized error', ->
             expect(@err).to.not.exist

    describe 'When we delete a Measure (DELETE /sensors/:sensorId/measures/:id)', ->

        it 'should allow requests', (done) ->
            @client.del "sensors/#{store.rule.id}/measures/#{store.measureId}", done

        it 'should return a "success"', ->
            expect(@err).to.not.exist

            expect(@body.sensorId).to.equal store.sensor.id
            expect(@body.type).to.equal fixtureMeasure.measureMovement1.type
            expect(@body.value).to.equal fixtureMeasure.measureMovement1.value
            expect(@body.time).to.equal fixtureMeasure.measureMovement1.time.toISOString()
            expect(@body.id).to.equal store.measureId

            
