         
         it 'should allow requests', (done) ->
             id = store.measureId + 404 # since "store.measureId" is the only correct ID in DB, "store.measureId + 404" is not.
-            @client.get "sensors/#{store.rule.id}/measures/#{id}", done
+            @client.get "sensors/#{store.sensor.id}/measures/#{id}", done
 
         it 'should return an error', ->
             expect(@response.statusCode).to.equal 404

    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


        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.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.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.sensor.id}/measures/#{store.measureId}", fixtureMeasure.updateMeasure, done

        it 'should return an unauthorized error', ->
            expect(@err).to.not.exist
