diff options
-rw-r--r-- | lib/caldav/query_builder.js | 2 | ||||
-rw-r--r-- | test/caldav/query_builder_test.js | 22 |
2 files changed, 23 insertions, 1 deletions
diff --git a/lib/caldav/query_builder.js b/lib/caldav/query_builder.js index 3d7c9eb..afa0063 100644 --- a/lib/caldav/query_builder.js +++ b/lib/caldav/query_builder.js @@ -46,7 +46,7 @@ string = string.toString(); } - content.push(string); + this.content.push(string); }, _timeRange: null, diff --git a/test/caldav/query_builder_test.js b/test/caldav/query_builder_test.js index 2e8bd8a..ea33c73 100644 --- a/test/caldav/query_builder_test.js +++ b/test/caldav/query_builder_test.js @@ -20,6 +20,28 @@ suite('caldav/query_builder', function() { template = new Template('container'); }); + suite('Node', function() { + var builder; + + setup(function() { + builder = new Builder({ template: template }); + }); + + test('export', function() { + assert.ok(Builder.Node); + }); + + test('#appendString', function() { + var subject = new Builder.Node(builder, 'foo'); + subject.appendString('<a></a>'); + var out = subject.toString(); + assert.equal( + out, + '<N0:comp name="foo"><a></a></N0:comp>' + ); + }); + }); + test('no template given', function() { assert.throws(function() { new Builder(); |