angular.js/docs/spec/domSpec.js
Vojta Jina 8978e066b5 fix(gen-docs): require files without touching PATH
So that it works on latest revision of node...
New version of Node (v0.5.x) does not support require.paths.push().
2011-10-18 22:23:52 -07:00

33 lines
736 B
JavaScript

var DOM = require('../src/dom.js').DOM;
describe('dom', function() {
var dom;
beforeEach(function() {
dom = new DOM();
});
describe('h', function() {
it('should render using function', function() {
var cbThis;
var cdValue;
dom.h('heading', 'content', function(value){
cbThis = this;
cbValue = value;
});
expect(cbThis).toEqual(dom);
expect(cbValue).toEqual('content');
});
it('should update heading numbers', function() {
dom.h('heading', function() {
this.html('<h1>sub-heading</h1>');
});
expect(dom.toString()).toContain('<h1>heading</h1>');
expect(dom.toString()).toContain('<h2>sub-heading</h2>');
});
});
});