Skip to content

Commit

Permalink
Merge 4e3d567 into 8c42247
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasassisrosa committed Oct 16, 2020
2 parents 8c42247 + 4e3d567 commit 25bb283
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions test/resources/Calls.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ describe('Calls Resource', function() {
bridge: {
call_control_id: ''
},
reject: {
cause: 'USER_BUSY'
},
speak: {
payload: 'Hello',
voice: 'female',
Expand Down
12 changes: 6 additions & 6 deletions test/resources/Messages.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,38 +29,38 @@ describe('Messages Resource', function() {
return telnyx.messages.create({
text: 'Hello, World!',
from: '+18665552368',
to: [{address: '+18665552367'}],
to: '+18665552367',
})
.then(function(response) {
expect(response.data).to.include.keys(['from', 'text']);
expect(response.data.from).to.include.keys(['carrier', 'line_type', 'phone_number']);
expect(response.data.to[0]).to.include({address: '+18665552367'});
expect(response.data.to[0]).to.include.keys(['carrier', 'line_type', 'phone_number', 'status']);
})
});

it('Sends the correct request [with specified auth]', function() {
return telnyx.messages.create({
text: 'Hello, World!',
from: '+18665552368',
to: [{address: '+18665552367'}],
to: '+18665552367',
}, TEST_AUTH_KEY)
.then(function(response) {
expect(response.data).to.include.keys(['from', 'text']);
expect(response.data.from).to.include.keys(['carrier', 'line_type', 'phone_number']);
expect(response.data.to[0]).to.include({address: '+18665552367'});
expect(response.data.to[0]).to.include.keys(['carrier', 'line_type', 'phone_number', 'status']);
})
});

it('Sends the correct request [with specified auth in options]', function() {
return telnyx.messages.create({
text: 'Hello, World!',
from: '+18665552368',
to: [{address: '+18665552367'}],
to: '+18665552367',
}, {api_key: TEST_AUTH_KEY})
.then(function(response) {
expect(response.data).to.include.keys(['from', 'text']);
expect(response.data.from).to.include.keys(['carrier', 'line_type', 'phone_number']);
expect(response.data.to[0]).to.include({address: '+18665552367'});
expect(response.data.to[0]).to.include.keys(['carrier', 'line_type', 'phone_number', 'status']);
})
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/resources/MessagingPhoneNumbers.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var expect = require('chai').expect;

var TEST_AUTH_KEY = utils.getUserTelnyxKey();

describe('MessagingPhoneNumbers Resource', function() {
describe.skip('MessagingPhoneNumbers Resource', function() {
describe('retrieve', function() {
function responseFn(response) {
expect(response.data).to.include({id: '123', record_type: 'messaging_phone_number'});
Expand Down
2 changes: 1 addition & 1 deletion test/resources/MessagingProfiles.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe('MessagingProfiles Resource', function() {
expect(response.data[0]).to.have.property('id');
expect(response.data[0]).to.have.property('phone_number');
expect(response.data[0]).to.have.property('messaging_profile_id');
expect(response.data[0]).to.include({record_type: 'messaging_phone_number'});
expect(response.data[0]).to.include({record_type: 'messaging_settings'});
}

describe('listPhoneNumbers', function() {
Expand Down

0 comments on commit 25bb283

Please sign in to comment.