From 7c3b12415cf8abde0711c5782c29ca79224d26d1 Mon Sep 17 00:00:00 2001 From: Justin Beaulne Date: Fri, 5 Jan 2018 18:32:16 -0600 Subject: [PATCH] Changed event() and fighter() to use json link --- lib/v3/api.js | 4 ++-- test/v3_api_test.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/v3/api.js b/lib/v3/api.js index eea2a96..4f347a3 100644 --- a/lib/v3/api.js +++ b/lib/v3/api.js @@ -56,7 +56,7 @@ var api = { }, fighter(id, done) { - sendRequest('GET', `${uriFor('fighters')}/${id}`, done); + sendRequest('GET', `${uriFor('fighters')}/${id}.json`, done); }, fighterStatsFilterKeyValues(done) { @@ -92,7 +92,7 @@ var api = { }, event(id, done) { - sendRequest('GET', `${uriFor('events')}/${id}`, done); + sendRequest('GET', `${uriFor('events')}/${id}.json`, done); }, eventFights(id, done) { diff --git a/test/v3_api_test.js b/test/v3_api_test.js index 2cf7cde..a1d99a4 100644 --- a/test/v3_api_test.js +++ b/test/v3_api_test.js @@ -171,7 +171,7 @@ describe("v3 api", function() { var fighterId = 1; nock('http://ufc-data-api.ufc.com/api/v3/us') - .get('/fighters/' + fighterId) + .get('/fighters/' + fighterId + '.json') .reply(200); api.fighter(fighterId, function (err, res) { @@ -300,11 +300,11 @@ describe("v3 api", function() { var eventId = 1; nock('http://ufc-data-api.ufc.com/api/v3/us') - .get('/events/' + eventId) + .get('/events/' + eventId + '.json') .reply(200); - + api.event(eventId, function (err, res) { - expect(res.statusCode).to.equal(200); + expect(res.statusCode).to.equal(200); done(); }); });