私のアプリケーションでは、すでにDOMにあるhtml要素にバインドされたビューがあります
var myView = Backbone.View.extend({
...
el: '#myElement',
...
});
次のジャスミン テストに問題があります。
beforeEach(function(){
//fixiture created with jasmin-jquery.js plugin
setFixtures('<div id="myElement"></div>');
this.myView = new MyView({model: new Model());
});
describe('when instantiated', function(){
it('should be associated to #myElement', function(){
expect(this.app.el).toBeDefined();
expect(this.app.el).toBe($('#myElement'));
});
});
テストは失敗し、 this.app.el == '' であることが判明しました
私は間違っていますか、これは正しい動作ではありませんか?