From 2d2778aea070e88f7b7e31cfe8cb0754399d49f9 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Mon, 3 Dec 2012 12:31:02 -0500 Subject: [PATCH] Test out way rep as well --- test/spec/XML.js | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/test/spec/XML.js b/test/spec/XML.js index a0b9675fc..c83089514 100644 --- a/test/spec/XML.js +++ b/test/spec/XML.js @@ -1,20 +1,24 @@ describe('XML', function() { - describe('#rep', function() { - it('converts a node to jxon', function() { - expect(iD.format.XML.rep({ id: 'n-1', type: 'node', lat: 38, lon: -77 })) - .toEqual({ node : { '@id': '-1', '@lat': 38, '@lon': -77, '@version': 0, tag: [ ] } }); - }); - }); + describe('#rep', function() { + it('converts a node to jxon', function() { + expect(iD.format.XML.rep({ id: 'n-1', type: 'node', lat: 38, lon: -77 })) + .toEqual({ node : { '@id': '-1', '@lat': 38, '@lon': -77, '@version': 0, tag: [ ] } }); + }); + it('converts a way to jxon', function() { + expect(iD.format.XML.rep({ id: 'w-1', type: 'way', nodes: [] })) + .toEqual({ way : { '@id' : '-1', nd : [ ], '@version': 0, tag: [ ] } }); + }); + }); - describe('#mapping', function() { - it('serializes a node to xml', function() { - expect(iD.format.XML.mapping({ id: 'n-1', type: 'node', lat: 38, lon: -77 })) - .toEqual('<node id="-1" lat="38" lon="-77" version="0"/>'); - }); + describe('#mapping', function() { + it('serializes a node to xml', function() { + expect(iD.format.XML.mapping({ id: 'n-1', type: 'node', lat: 38, lon: -77 })) + .toEqual('<node id="-1" lat="38" lon="-77" version="0"/>'); + }); - it('serializes a way to xml', function() { - expect(iD.format.XML.mapping({ type: 'way', nodes: [], id: 'w-1' })) - .toEqual('<way id="-1" version="0"/>'); - }); - }); + it('serializes a way to xml', function() { + expect(iD.format.XML.mapping({ type: 'way', nodes: [], id: 'w-1' })) + .toEqual('<way id="-1" version="0"/>'); + }); + }); });