Skip to content

Commit

Permalink
test to confirm close #1004
Browse files Browse the repository at this point in the history
  • Loading branch information
Eran Hammer committed Oct 1, 2013
1 parent c164493 commit ee41c06
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/integration/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,29 @@ describe('Validation', function () {
});
});

it('validates valid input (Object root)', function (done) {

var server = new Hapi.Server();
server.route({
method: 'GET',
path: '/',
handler: function () { this.reply('ok'); },
config: {
validate: {
query: Hapi.types.Object({
a: Hapi.types.String().min(2)
})
}
}
});

server.inject('/?a=123', function (res) {

expect(res.statusCode).to.equal(200);
done();
});
});

it('fails on invalid input', function (done) {

var server = new Hapi.Server();
Expand Down

0 comments on commit ee41c06

Please sign in to comment.