Fix #1228 - tagName can be provided as a function.

This commit is contained in:
Brad Dunbar
2012-04-17 10:17:37 -04:00
parent e1e42571a7
commit 5fc8005c83
2 changed files with 7 additions and 2 deletions

View File

@@ -217,8 +217,13 @@ $(document).ready(function() {
test("Clone attributes object", function() {
var View = Backbone.View.extend({attributes: {foo: 'bar'}});
var v1 = new View({id: 'foo'});
ok(v1.el.id === 'foo');
strictEqual(v1.el.id, 'foo');
var v2 = new View();
ok(!v2.el.id);
});
test("#1228 - tagName can be provided as a function", function() {
var View = Backbone.View.extend({tagName: function(){ return 'p'; }});
ok(new View().$el.is('p'));
});
});