Skip to content

Commit d008f60

Browse files
committed
Add failing test
1 parent 752953b commit d008f60

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/create.test.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,22 @@ describe('loopback json api component create method', function () {
2121
});
2222

2323
describe('headers', function () {
24+
it('POST /models should be created when Accept header is set to application/vnd.api+json', function (done) {
25+
request(app).post('/posts')
26+
.send({
27+
data: {
28+
type: 'posts',
29+
attributes: {
30+
title: 'my post',
31+
content: 'my post content'
32+
}
33+
}
34+
})
35+
.set('Accept', 'application/vnd.api+json')
36+
.set('Content-Type', 'application/json')
37+
.expect(201)
38+
.end(done);
39+
});
2440
it('POST /models should have the JSON API Content-Type header set on response', function (done) {
2541
//TODO: superagent/supertest breaks when trying to use JSON API Content-Type header
2642
//waiting on a fix

0 commit comments

Comments
 (0)