Skip to content
This repository has been archived by the owner on Feb 23, 2021. It is now read-only.

Commit

Permalink
fixed test.
Browse files Browse the repository at this point in the history
  • Loading branch information
tamarahills committed Sep 1, 2018
1 parent 5718b54 commit 5271dcb
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions test/unit/CommandController.endpoints-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,17 @@ describe('CommandController - Endpoints', function() {
return url == 'audio_file_url';
})
);
sinon.replace(
AudioFileHelper.prototype,
'getMobileFileMetadata',
sinon.fake(function() {
console.log('Calling fake getMobileFileMetadata');
return {
fileUrl: 'audio_file_url',
duration: 300
};
})
);
sinon.replace(
AudioFileHelper.prototype,
'getMetaAudioLocation',
Expand Down Expand Up @@ -583,15 +594,6 @@ describe('CommandController - Endpoints', function() {
});

it('should return metadata for the article', done => {
var getMobileStub = sinon.stub(
AudioFileHelper.prototype,
'getMobileFileMetadata'
);
getMobileStub.returns({
fileUrl: 'audio_file_url',
duration: 300
});

chai
.request(app)
.post('/command/articleservice')
Expand All @@ -602,7 +604,6 @@ describe('CommandController - Endpoints', function() {
expect(res.body).be.a('object');
done();
});
getMobileStub.restore();
});

it('should return 404 when no article_id is sent', done => {
Expand Down

0 comments on commit 5271dcb

Please sign in to comment.