Skip to content

Commit

Permalink
Corrected starships url (#19)
Browse files Browse the repository at this point in the history
* Corrected starships url

* Corrected starship url from test
  • Loading branch information
rcarvalhoxavier authored and lholmquist committed Sep 7, 2017
1 parent da9aa7e commit cb5f0ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/swapi-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ module.exports = {
},
getStarship (options) {
var opts = parseOptions(options);
return makeRequest('starship' + (opts.id ? '/' + opts.id : '/'));
return makeRequest('starships' + (opts.id ? '/' + opts.id : '/'));
},
getVehicle (options) {
var opts = parseOptions(options);
Expand Down
6 changes: 3 additions & 3 deletions test/swapi-api-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ test('GET starship', (t) => {
nock('http://swapi.co/api/')
.matchHeader('User-Agent', 'swapi-node')
.matchHeader('SWAPI-Node-Version', version)
.get('/starship/1')
.get('/starships/1')
.reply(200, {});

const request = swapi.getStarship(1).then((result) => {
Expand All @@ -121,7 +121,7 @@ test('GET starship - with options', (t) => {
nock('http://swapi.co/api/')
.matchHeader('User-Agent', 'swapi-node')
.matchHeader('SWAPI-Node-Version', version)
.get('/starship/1')
.get('/starships/1')
.reply(200, {});

const request = swapi.getStarship({id: 1}).then((result) => {
Expand All @@ -134,7 +134,7 @@ test('GET starship - with error', (t) => {
nock('http://swapi.co/api/')
.matchHeader('User-Agent', 'swapi-node')
.matchHeader('SWAPI-Node-Version', version)
.get('/starship/1')
.get('/starships/1')
.reply(400, {});

const request = swapi.getStarship({id: 1}).then(null, (result) => {
Expand Down

0 comments on commit cb5f0ab

Please sign in to comment.