         payload.oncalls[0].end = @end_time.format()
         room.robot.brain.data.pagerv2 = { users: { } }
         nock('https://api.pagerduty.com')
-        .get('/oncalls?time_zone=UTC&schedule_ids%5B%5D=42&earliest=true')
+        .get('/oncalls')
+        .query({
+          time_zone: 'UTC',
+          schedule_ids: [ 42 ],
+          earliest: true
+        })
         .reply 200, payload
       afterEach ->
         room.robot.brain.data.pagerv2 = { }

      beforeEach ->
        room.robot.brain.data.pagerv2 = { users: { } }
        nock('https://api.pagerduty.com')
        .get('/oncalls?time_zone=UTC&schedule_ids%5B%5D=42&earliest=true')
        .reply 503, { error: { code: 503, message: "it's all broken!" } }
      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(200, require('./fixtures/oncall_list-ok.json'))
        .filteringPath( (path) ->
          path.replace /(since|until)=[^&]*/g, '$1=x'
        )
        .get('/oncalls')
        .query({
          time_zone: 'UTC',
          schedule_ids: [ 42 ],
          earliest: true,
          since: 'x',
          until: 'x'
        })
        .reply 200, require('./fixtures/oncall_list_next-ok.json')
      afterEach ->
        room.robot.brain.data.pagerv2 = { }
