-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Testing: Partially convert Service tests to ngDescribe style;
- Loading branch information
1 parent
cb54fc0
commit d94bfec
Showing
3 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
ngDescribe({ | ||
name: 'Service: Geolocation tests', | ||
modules: 'atstop', | ||
inject: 'GeolocationService', | ||
tests: function(deps) { | ||
it('should return nearby stops', function() { | ||
var lat = 40.748433; | ||
var lon = -73.985656; | ||
deps.GeolocationService.getStops(lat, lon).then(function(results) { | ||
expect(results.length).to.BeGreaterThan(0); | ||
}); | ||
}); | ||
} | ||
}); | ||
|
||
ngDescribe({ | ||
name: 'Service: At Stop Service tests (note: server/data dependent)', | ||
modules: 'atstop', | ||
inject: 'AtStopService', | ||
tests: function(deps) { | ||
it('should return results for a stop', function() { | ||
var stop = 'MTA_400861'; | ||
deps.AtStopService.getBuses(stop).then(function(results) { | ||
expect(Object.keys(data.arriving).length).toBeGreaterThan(1); | ||
}); | ||
}); | ||
|
||
it('should return results for one route at a stop', function() { | ||
var stop = 'MTA_400861'; | ||
var line = 'MTA NYCT_M7'; | ||
var params = { | ||
'stop': stop, | ||
'line': line | ||
}; | ||
var data = {}; | ||
deps.AtStopService.getBuses(params).then(function(results) { | ||
except(Object.keys(data.arriving).length).toBeEqualTo(1); | ||
}); | ||
}); | ||
} | ||
}); |