Skip to content

Commit

Permalink
Update _app_serial_id constraint to accept integer values
Browse files Browse the repository at this point in the history
  • Loading branch information
ruimarinho committed Dec 11, 2016
1 parent 9cc9edb commit 7b8f1eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export default class Client {
assert(response, {
approval_request: {
_app_name: [is.required(), is.string()],
_app_serial_id: [is.required(), is.string()],
_app_serial_id: [is.required(), is.integer()],
_authy_id: [is.required(), is.authyId()],
_id: [is.required(), is.string()],
_user_email: [is.required(), is.email()],
Expand Down
4 changes: 2 additions & 2 deletions test/client_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ describe('Client', () => {
nock(/authy/).get(/\//).reply(200, {
approval_request: {
_app_name: 123,
_app_serial_id: 123,
_app_serial_id: '123',
_authy_id: 'foo',
_id: 123,
_user_email: 'bar',
Expand All @@ -882,7 +882,7 @@ describe('Client', () => {
e.should.be.instanceOf(AssertionFailedError);

e.errors.approval_request._app_name[0].show().assert.should.equal('IsString');
e.errors.approval_request._app_serial_id[0].show().assert.should.equal('IsString');
e.errors.approval_request._app_serial_id[0].show().assert.should.equal('Integer');
e.errors.approval_request._authy_id[0].show().assert.should.equal('AuthyId');
e.errors.approval_request._id[0].show().assert.should.equal('IsString');
e.errors.approval_request._user_email[0].show().assert.should.equal('Email');
Expand Down

0 comments on commit 7b8f1eb

Please sign in to comment.