Skip to content

Instantly share code, notes, and snippets.

@brycec
Created August 15, 2013 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brycec/6243349 to your computer and use it in GitHub Desktop.
Save brycec/6243349 to your computer and use it in GitHub Desktop.
wasted spacetime
/**
* @mixin
* Mixin static functionality to a magnet
**/
define(function () {
return {
/**
* Get the visibility types for a magnet
* @return {object} an object with keys of types to their values
**/
getVisibilityTypes: function () {
return {
'default': null,
'public': 'public',
'private': 'private'
};
},
/**
* Get the busy types for a magnet mapped to the value
* @return {Object} an object with the type / value mappings
**/
getBusyTypes: function () {
return {
'busy': true,
'free': false
};
}
};
});
/**
* Tests for the static mixin
**/
define([
'app/models/magnet'
], function (Magnet) {
describe('app/models/magnet/staticMixin', function() {
describe('getVisibilityTypes', function() {
it('returns various types of visibility', function() {
expect(Magnet.getVisibilityTypes()).toEqual({
'public': 'public',
'private': 'private',
'default': null
});
});
});
describe('getBusyTypes', function () {
it('returns types of busy', function () {
expect(Magnet.getBusyTypes()).toEqual({
'busy': true,
'free': false
});
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment