Skip to content
This repository has been archived by the owner on May 16, 2020. It is now read-only.

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kashav committed Apr 24, 2016
1 parent 3208cbb commit fad68e0
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions test/athletics/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,19 @@ test.cb('/filter?q=date:"2016,04,01"', t => {
})
})

test.cb('/filter?q=date:"2016-04-01"', t => {
request(cobalt.Server)
.get('/1.0/athletics/filter?q=start:%222016-04-0122')
.expect('Content-Type', /json/)
.expect(200)
.expect('[]')
.end((err, res) => {
if (err) t.fail(err.message)
t.pass()
t.end()
})
})

test.cb('/filter?q=start:<"2016,04,02,13"', t => {
request(cobalt.Server)
.get('/1.0/athletics/filter?q=start:%3C%222016,04,02,13%22')
Expand Down Expand Up @@ -323,7 +336,7 @@ test.cb('/filter?q=start:<"2016,04,02,13"', t => {
})
})

test.cb('/filter?q=location:"gym" AND end:<="2016,04,11,13" AND start:>="2016,04,10"', t => {
test.cb('/filter?q=location:"gym" AND end:<="2016,04,11,13" AND start:>="2016-04-10"', t => {
request(cobalt.Server)
.get('/1.0/athletics/filter?q=location:%22gym%22%20AND%20end:%3C=%222016,04,11,13%22%20AND%20start:%3E=%222016,04,10%22')
.expect('Content-Type', /json/)
Expand All @@ -350,18 +363,6 @@ test.cb('/filter?q=location:"gym" AND end:<="2016,04,11,13" AND start:>="2016,04
})
})

test.cb('/filter?q=date:"2016-04-01"', t => {
request(cobalt.Server)
.get('/1.0/athletics/filter?q=start:%222016-04-0122')
.expect('Content-Type', /json/)
.expect(400)
.end((err, res) => {
if (err) t.fail(err.message)
t.pass()
t.end()
})
})

test.cb.after('cleanup', t => {
Athletics.remove({}, err => {
if (err) t.fail(err.message)
Expand Down

0 comments on commit fad68e0

Please sign in to comment.