Skip to content

Instantly share code, notes, and snippets.

@tatey
Last active December 30, 2015 18:19
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 tatey/7867043 to your computer and use it in GitHub Desktop.
Save tatey/7867043 to your computer and use it in GitHub Desktop.
You *can* have nested describes in Jasmine.
describe('util.Config', function() {
describe('.openerType', function() {
var Config, Device;
beforeEach(function() {
Device = {};
Config = theBestDay.require('widget.Config', {'util.Device': Device});
});
describe('desktop', function() {
beforeEach(function() {
Device.isMobile = function() { return false; };
});
it('defaults to config', function() {
var url = Config.childUrl();
expect(url).toBe('<%= site.config["child"]["desktop_url"] %>');
});
it('is given child URL', function() {
var url = Config.childUrl({mobile: '/mobile', desktop: '/desktop'});
expect(url).toBe('/desktop');
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment