Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
describe('GET potatoes', function() {
it('returns JSON with only authenticated robot\'s potatoes', function*() {
const glados = yield factory.create('robot');
const gladosPotatoes = [
yield factory.create('potato', { ownerId: });
yield factory.create('potato', { ownerId: });
const wheatley = yield factory.create('robot');
const wheatleyPotato =
yield factory.create('potato', { ownerId: });
const response = yield request.auth(glados).get('/potatoes');
const potatoesResponse = response.body.potatoes;
const returnedIds = _.pluck(potatoesResponse, 'id');
expect(returnedIds).to.include(_.pluck(gladosPotatoes, 'id'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.