forked from groupme/bot-tutorial-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
43 lines (38 loc) · 1.08 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
const chai = require('chai')
const chaiHttp = require('chai-http')
const server = require('./index.js')
const should = chai.should()
chai.use(chaiHttp)
describe('GroupMeme Bot Tests', function () {
it('should render a basic form on / GET')
it('should send a message on a /send POST')
it('should process incoming messages on / POST')
})
it('should render a basic form on / GET', function (done) {
chai.request(server)
.get('/')
.end(function (err, res) {
res.should.have.status(200)
res.should.be.html
done()
})
})
it('should send a message on a /send POST', function (done) {
chai.request(server)
.post('/send')
.send({'message': 'test', 'imageUrl': 'http://reddit.com/thatsthejoke.jpg'})
.end(function (err, res) {
res.should.have.status(200)
res.should.be.html
done()
})
})
it('should process incoming messages on / POST', function (done) {
chai.request(server)
.post('/')
.send({'text': 'meme', 'name': 'Not Beep Boop'})
.end(function (err, res) {
res.should.have.status(200)
done()
})
})