Skip to content

Commit 148dfed

Browse files
committed
Test for rest options.
1 parent e448982 commit 148dfed

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

test/rest.middleware.test.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,14 @@ describe('loopback.rest', function() {
7575
});
7676
});
7777

78-
xit('should support options', function(done) {
78+
it('should support options', function(done) {
7979
app.model(MyModel);
80-
app.use(loopback.rest({errorHandler: {disableStackTrace: true}}));
81-
request(app).get('/mymodels/1')
82-
.end(function(err, res) {
83-
if (err) return done(err);
84-
expect(res.body.error.stack).to.be.undefined;
85-
done();
86-
});
80+
var supportedTypes = ['json', 'application/javascript', 'text/javascript'];
81+
app.use(loopback.rest({supportedTypes: supportedTypes}));
82+
request(app).get('/mymodels')
83+
.set('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8')
84+
.expect('Content-Type', 'application/json; charset=utf-8')
85+
.expect(200, done);
8786
});
8887

8988
it('includes loopback.token when necessary', function(done) {

0 commit comments

Comments
 (0)