mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Merge pull request #5556 from Matt-Yorkley/geocoding-service
Rename Angular Geo service
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
describe "Enterprises service", ->
|
||||
Enterprises = $rootScope = null
|
||||
CurrentHubMock = {}
|
||||
Geo =
|
||||
GmapsGeo =
|
||||
OK: 'ok'
|
||||
succeed: true
|
||||
geocode: (query, callback) ->
|
||||
@@ -31,7 +31,7 @@ describe "Enterprises service", ->
|
||||
module 'Darkswarm'
|
||||
module ($provide)->
|
||||
$provide.value "CurrentHub", CurrentHubMock
|
||||
$provide.value "Geo", Geo
|
||||
$provide.value "GmapsGeo", GmapsGeo
|
||||
null
|
||||
angular.module('Darkswarm').value('enterprises', enterprises)
|
||||
angular.module('Darkswarm').value('taxons', taxons)
|
||||
@@ -118,12 +118,12 @@ describe "Enterprises service", ->
|
||||
spyOn(Enterprises, "setDistanceFrom")
|
||||
|
||||
it "calculates distance for all enterprises when geocoding succeeds", ->
|
||||
Geo.succeed = true
|
||||
GmapsGeo.succeed = true
|
||||
Enterprises.calculateDistanceGeo('query')
|
||||
expect(Enterprises.setDistanceFrom).toHaveBeenCalledWith("location")
|
||||
|
||||
it "resets distance when geocoding fails", ->
|
||||
Geo.succeed = false
|
||||
GmapsGeo.succeed = false
|
||||
spyOn(Enterprises, "resetDistance")
|
||||
Enterprises.calculateDistanceGeo('query')
|
||||
expect(Enterprises.setDistanceFrom).not.toHaveBeenCalled()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
describe "Hubs service", ->
|
||||
OfnMap = null
|
||||
CurrentHubMock = {}
|
||||
Geo = {}
|
||||
GmapsGeo = {}
|
||||
enterprises = [
|
||||
{
|
||||
id: 2
|
||||
@@ -54,7 +54,7 @@ describe "Hubs service", ->
|
||||
angular.module('Darkswarm').value('enterprises', enterprises)
|
||||
module ($provide)->
|
||||
$provide.value "CurrentHub", CurrentHubMock
|
||||
$provide.value "Geo", Geo
|
||||
$provide.value "GmapsGeo", GmapsGeo
|
||||
null
|
||||
inject ($injector)->
|
||||
OfnMap = $injector.get("OfnMap")
|
||||
|
||||
@@ -12,7 +12,7 @@ describe 'Products service', ->
|
||||
productWithImage = null
|
||||
properties = null
|
||||
taxons = null
|
||||
Geo = {}
|
||||
GmapsGeo = {}
|
||||
endpoint = "/api/order_cycles/1/products?distributor=1"
|
||||
|
||||
beforeEach ->
|
||||
@@ -53,7 +53,7 @@ describe 'Products service', ->
|
||||
$provide.value "currentOrder", currentOrder
|
||||
$provide.value "taxons", taxons
|
||||
$provide.value "properties", properties
|
||||
$provide.value "Geo", Geo
|
||||
$provide.value "GmapsGeo", GmapsGeo
|
||||
$provide.value "OrderCycle", OrderCycle
|
||||
$provide.value "railsFlash", null
|
||||
null
|
||||
|
||||
Reference in New Issue
Block a user