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

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kashav committed Apr 30, 2016
1 parent f2c235e commit 8e7091e
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions test/exams/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,22 @@ test.cb('/filter?q=date:"2016-04-28"', t => {
})
})

test.cb('/filter?q=date:>"2016-04-30"', t => {
test.cb('/filter?q=date:>=1461988800', t => {
request(cobalt.Server)
.get('/1.0/exams/filter?q=date:%3E%222016-04-30%22')
.get('/1.0/exams/filter?q=date:%3E=1461988800')
.expect('Content-Type', /json/)
.expect(200)
.expect(testData.slice(0, 10))
.end((err, res) => {
if (err) t.fail(err.message)
t.pass()
t.end()
})
})

test.cb('/filter?q=date:<="2016,04,30"', t => {
request(cobalt.Server)
.get('/1.0/exams/filter?q=date:%3E=%222016,04,30%22')
.expect('Content-Type', /json/)
.expect(200)
.expect('[]')
Expand Down Expand Up @@ -352,6 +365,19 @@ test.cb('/filter?q=duration:<=10800', t => {
})
})

test.cb('/filter?q=duration:-7200', t => {
request(cobalt.Server)
.get('/1.0/exams/filter?q=duration:-7200')
.expect('Content-Type', /json/)
.expect(200)
.expect(testData.filter(doc => doc.duration !== 7200).slice(0, 10))
.end((err, res) => {
if (err) t.fail(err.message)
t.pass()
t.end()
})
})

test.cb('/filter?q=location:"HI CART"', t => {
request(cobalt.Server)
.get('/1.0/exams/filter?q=location:%22HI%20CART%22')
Expand Down

0 comments on commit 8e7091e

Please sign in to comment.