client.serie.unsubscribeSeries(id, userId, function(err) {
        assert.ok(!err);

        // If no `userId` was specified, the current user would have been
        // unsubscribed. We get the current user's user id from the me feed
        UsersTestsUtil.assertGetMe(client, function(me) {
            if (!userId) {
                userId = me.id;
            }

            // Get the events in this serie so we can verify they no longer appear in the user's calendar
            assertGetSeriesEvents(client, id, null, null, null, null, function(seriesEvents) {

                // Generate a broad window for the user's calendar
                var start = moment().subtract(30, 'days');
                var end = moment().add(30, 'days');

                var startEndRange = _findStartAndEndRange(seriesEvents);
                if (seriesEvents) {
                    start = moment(startEndRange[0]).subtract(1, 'hour');
                    end = moment(startEndRange[1]).add(1, 'hour');
                }

                // Get the user's calendar
                UsersTestsUtil.assertGetUserCalendar(client, userId, start.format(), end.format(), null, function(calendar) {
                    _.each(calendar.results, function(event) {
                        assert.ok(!_.find(seriesEvents, {'id': event.id}));
                    });

                    return callback();
                });
            });
        });
    });
    assertGetSeries(client, id, null, null, null, function(series) {

        // Get the me feed so we have access to the application's display name
        UsersTestsUtil.assertGetMe(client, function(me) {

            // Get the iCal calendar for the series
            client.serie.getSeriesCalendarIcal(id, start, end, function(err, calendar, response) {
                assert.ok(!err);

                // Assert the response is iCal
                assert.strictEqual(response.headers['content-type'], 'text/calendar; charset=utf-8');

                // Parse the iCal calendar
                TestsUtil.parseIcalCalendar(calendar, me.app.displayName, series.displayName, function(calendar) {

                    // Check if the returned events are the ones we expected
                    if (expectedEvents) {
                        assert.strictEqual(calendar.subComponents.length, expectedEvents.length);
                        _.each(calendar.subComponents, function(subComponent, i) {
                            var id = parseInt(subComponent.model.uid, 10);
                            assert.strictEqual(id, expectedEvents[i].id);
                            assert.strictEqual(subComponent.model.summary, expectedEvents[i].displayName);
                        });
                    }

                    return callback(calendar);
                });
            });
        });
    });