Skip to content

Instantly share code, notes, and snippets.

@joelklabo
Created June 21, 2012 18:01
Show Gist options
  • Save joelklabo/2967385 to your computer and use it in GitHub Desktop.
Save joelklabo/2967385 to your computer and use it in GitHub Desktop.
FROM THIS:
describe('.setCurrentUser', function (){
it('creates message types for the user', function (){
yam.setCurrentUser({
id: 1
, attachments: [
{ app_id: 'praise', name: 'foo' }
, { app_id: 'polls', name: 'bar' }
, { app_id: 'notonwhitelist', name: 'baz' }
]
});
var messageTypes = yam.getCurrentUser().getMessageTypes();
expect(messageTypes.length).to(be, 3);
var ids = _.map(messageTypes, function (mt){ return mt.app_id; }).sort();
expect(ids).to(equal, ['polls', 'praise', 'update']);
});
});
TO THIS:
describe('.setCurrentUser', function (){
it('creates message types for the user', function (){
yam.setCurrentUser({
id: 1
, attachments: [
{ app_id: 'praise', name: 'foo' }
, { app_id: 'polls', name: 'bar' }
, { app_id: 'notonwhitelist', name: 'baz' }
]
, publisher_options: [
{ app_id: 'praise', name: 'foo' }
, { app_id: 'polls', name: 'bar' }
, { app_id: 'notonwhitelist', name: 'baz' }
]
});
var messageTypes = yam.getCurrentUser().getMessageTypes();
expect(messageTypes.length).to(be, 3);
var ids = _.map(messageTypes, function (mt){ return mt.app_id; }).sort();
expect(ids).to(equal, ['polls', 'praise', 'update']);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment