       beforeEach ->
         room.robot.brain.data.pagerv2 = { users: { } }
         nock('https://api.pagerduty.com')
-        .get('/users?query=toto%40example.com')
+        .get('/users')
+        .query({
+          query: 'toto@example.com'
+        })
         .reply 200, require('./fixtures/users_list-match.json')
       afterEach ->
         room.robot.brain.data.pagerv2 = { }

      beforeEach ->
        room.robot.brain.data.pagerv2 = { users: { } }
        nock('https://api.pagerduty.com')
        .get('/users?query=toto%40example.com')
        .replyWithError({ message: "server error", code: 500 })
      afterEach ->
        room.robot.brain.data.pagerv2 = { }

      beforeEach ->
        room.robot.brain.data.pagerv2 = { users: { } }
        nock('https://api.pagerduty.com')
        .get('/oncalls')
        .query({
          time_zone: 'UTC',
          schedule_ids: [ 42 ],
          earliest: true
        })
        .reply 503, { error: { code: 503, message: "it's all broken!" } }
      afterEach ->
        room.robot.brain.data.pagerv2 = { }
