diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2012-05-04 16:57:31 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2012-05-04 16:57:31 +0200 |
commit | 3a7e65ca638bfcd615dcd24d4ee800596621be8b (patch) | |
tree | 76121f6812dbe0ae4867477828c570e330f561de /test | |
parent | a55635dd4da622a82a091b13c533388e0d8a28cb (diff) | |
download | bitraf-bot-3a7e65ca638bfcd615dcd24d4ee800596621be8b.tar.gz bitraf-bot-3a7e65ca638bfcd615dcd24d4ee800596621be8b.tar.bz2 bitraf-bot-3a7e65ca638bfcd615dcd24d4ee800596621be8b.tar.xz bitraf-bot-3a7e65ca638bfcd615dcd24d4ee800596621be8b.zip |
o Adding a small module to process application/vnd.collection+json documents.
Diffstat (limited to 'test')
-rw-r--r-- | test/checkins.test.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/checkins.test.js b/test/checkins.test.js new file mode 100644 index 0000000..66514de --- /dev/null +++ b/test/checkins.test.js @@ -0,0 +1,27 @@ +var BitrafBot = require('../lib/BitrafBot.js') + , assert = require('assert'); + +var json = JSON.stringify({ "collection": { + "version": "1.0", + "links": [], + "items": [ + { "data": [ + {"name": "date", "value": "2012-05-04"}, + {"name": "checkins", "value": "4"}, + {"name": "last-checkin", "value": "2012-05-04T16:09:20+02:00"} ] + } + ], + "sort": { + "fields": [ + { "name": "date" }, + { "name": "checkins" } + ] + } +}}); + +describe('Checkins', function() { + it('can parse checkins', function() { + var str = BitrafBot.onCheckinsEnd(json); + assert.equal('checkins: 4, last checkin: 2012-05-04T16:09:20+02:00', str); + }); +}); |