diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-08-11 14:33:27 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-08-11 14:33:27 +0200 |
| commit | 3f91689bc9a4560b29bac1b48ac81aebe83e3c2a (patch) | |
| tree | 30baec5c2681ebba956acef3fd6dcb3e7976c444 /rides/rides_test.go | |
| parent | 7d13374eec8c33c4e14cc5b0c3de36e4f620ce0e (diff) | |
feat: Save Strava activities without routes
Diffstat (limited to 'rides/rides_test.go')
| -rw-r--r-- | rides/rides_test.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/rides/rides_test.go b/rides/rides_test.go index 1c382b0..eb705fa 100644 --- a/rides/rides_test.go +++ b/rides/rides_test.go @@ -117,6 +117,23 @@ func TestSaveComputesCotacol(t *testing.T) { assert.Equal(t, ride.CotacolAlgorithmVersion, got.CotacolAlgorithmVersion()) } +func TestSaveAllowsRideWithoutGPX(t *testing.T) { + db := newTestDB(t) + indoor := sampleRide(t) + indoor.ExternalID = "strava:14701658670" + indoor.GPXPath = "" + + require.NoError(t, Save(db, indoor)) + + got, found, err := GetByExternalID(db, indoor.ExternalID) + require.NoError(t, err) + require.True(t, found) + assert.Empty(t, got.GPXPath) + _, ready := got.CotacolScore() + assert.False(t, ready) + assert.Empty(t, got.CotacolAlgorithmVersion()) +} + func TestBackfill(t *testing.T) { db := newTestDB(t) require.NoError(t, Save(db, sampleRide(t))) |