Comparing version 1.5.0 to 1.5.1
@@ -51,2 +51,3 @@ /** | ||
var endpoint = 'activities/' | ||
, form = util.getRequestBodyObj(_updateAllowedProps,args) | ||
, err = null; | ||
@@ -62,3 +63,3 @@ | ||
args.body = util.getRequestBodyObj(_updateAllowedProps,args); | ||
args.form = form; | ||
@@ -65,0 +66,0 @@ util.putEndpoint(endpoint,args,done); |
{ | ||
"name": "strava-v3", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"description": "Simple wrapper for strava v3 api", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -6,9 +6,21 @@ /** | ||
var should = require("should") | ||
, strava = require("../"); | ||
, strava = require("../") | ||
, testHelper = require("./_helper"); | ||
var testActivity = {} | ||
; | ||
, _sampleActivityPreEdit | ||
, _sampleActivity; | ||
describe('activities', function() { | ||
before(function(done) { | ||
testHelper.getSampleActivity(function(err,sampleActivity) { | ||
_sampleActivity = sampleActivity; | ||
_sampleActivityPreEdit = sampleActivity; | ||
done(); | ||
}); | ||
}); | ||
describe('#create()', function () { | ||
@@ -45,3 +57,3 @@ | ||
it('should return information about the corresponding activity', function(done) { | ||
strava.activities.get({id: 62215796/*testActivity.id*/}, function (err, payload) { | ||
strava.activities.get({id: _sampleActivity.id}, function (err, payload) { | ||
@@ -66,7 +78,7 @@ if (!err) { | ||
var args = { | ||
id:testActivity.id | ||
, description:"that description done been edited" | ||
, name:"should've been running" | ||
}; | ||
var name = "Run like the wind!!" | ||
, args = { | ||
id:_sampleActivity.id | ||
, name:name | ||
}; | ||
@@ -76,10 +88,22 @@ strava.activities.update(args, function (err, payload) { | ||
if (!err) { | ||
console.log(payload); | ||
(payload.resource_state).should.be.exactly(3); | ||
(payload.name).should.be.exactly(name); | ||
//great! that works, so revert the activity data back to what it was | ||
args = { | ||
id:_sampleActivity.id | ||
, description:_sampleActivityPreEdit.description | ||
, name:_sampleActivityPreEdit.name | ||
}; | ||
strava.activities.update(args,function(err,payload){ | ||
(payload.resource_state).should.be.exactly(3); | ||
(payload.name).should.be.exactly(_sampleActivityPreEdit.name); | ||
done(); | ||
}); | ||
} | ||
else { | ||
console.log(err); | ||
done(); | ||
} | ||
done(); | ||
}); | ||
@@ -93,3 +117,3 @@ }); | ||
strava.activities.listZones({id:testActivity.id}, function (err, payload) { | ||
strava.activities.listZones({id:_sampleActivity.id}, function (err, payload) { | ||
@@ -113,3 +137,3 @@ if (!err) { | ||
strava.activities.listLaps({id:testActivity.id}, function (err, payload) { | ||
strava.activities.listLaps({id:_sampleActivity.id}, function (err, payload) { | ||
@@ -133,3 +157,3 @@ if (!err) { | ||
strava.activities.listComments({id:testActivity.id}, function (err, payload) { | ||
strava.activities.listComments({id:_sampleActivity.id}, function (err, payload) { | ||
@@ -153,3 +177,3 @@ if (!err) { | ||
strava.activities.listKudos({id:testActivity.id}, function (err, payload) { | ||
strava.activities.listKudos({id:_sampleActivity.id}, function (err, payload) { | ||
@@ -173,3 +197,3 @@ if (!err) { | ||
strava.activities.listPhotos({id:testActivity.id}, function (err, payload) { | ||
strava.activities.listPhotos({id:_sampleActivity.id}, function (err, payload) { | ||
@@ -226,2 +250,3 @@ if (!err) { | ||
}); | ||
}); |
@@ -109,3 +109,3 @@ | ||
if(!err) { | ||
console.log(payload); | ||
//console.log(payload); | ||
(payload.resource_state).should.be.exactly(3); | ||
@@ -112,0 +112,0 @@ (payload.city).should.be.exactly("Seattle"); |
@@ -9,5 +9,5 @@ /** | ||
describe('uploads', function(){ | ||
describe.skip('uploads', function(){ | ||
describe.only('#post()', function() { | ||
describe('#post()', function() { | ||
@@ -14,0 +14,0 @@ it('should post example activity to strava', function(done) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54966
37
1424