Skip to content

Commit

Permalink
Adding specs for default options
Browse files Browse the repository at this point in the history
  • Loading branch information
sbellity committed Mar 8, 2013
1 parent 9065039 commit 26e40c3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/ext/widgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ define('aura/ext/widgets', function() {
return function(app) {

var core = app.core;
var _ = app.core.util._;
core.Widgets = core.Widgets || {};

var ownProp = function(obj, key) {
Expand Down
7 changes: 7 additions & 0 deletions spec/lib/ext/widgets_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ define(['aura/aura', 'aura/ext/widgets'], function (aura, ext) {
var app, options;

var myAltWidget = makeSpyWidget('alt_namespace', {
options: {
foo: 'bar',
another: 'toutafait'
},
initialize: function () {
options = this.options;
}
Expand All @@ -77,6 +81,7 @@ define(['aura/aura', 'aura/ext/widgets'], function (aura, ext) {
var markup = '<div ' +
' data-super-widget="alt_namespace" ' +
' data-super-param-name="value" ' +
' data-super-foo="notbar" ' +
' data-super-sourceUrl="url" ' +
' data-super-fuNNy-Case-PaRAm="yep" ' +
' data-super-param_name-With-un_der_scores="underscore"' +
Expand All @@ -95,6 +100,8 @@ define(['aura/aura', 'aura/ext/widgets'], function (aura, ext) {
});

it('It should take the right options too...', function () {
options.another.should.equal('toutafait');
options.foo.should.equal('notbar');
options.sourceurl.should.equal('url');
options.paramName.should.equal('value');
options.funnyCaseParam.should.equal('yep');
Expand Down

0 comments on commit 26e40c3

Please sign in to comment.