mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-04 22:16:08 +00:00
Further patches to the damned RABL system, patching everything up to use our new Service structure
This commit is contained in:
@@ -9,7 +9,7 @@ describe 'ProductsCtrl', ->
|
||||
Product =
|
||||
all: ->
|
||||
update: ->
|
||||
data: "testy mctest"
|
||||
products: "testy mctest"
|
||||
OrderCycle =
|
||||
order_cycle: {}
|
||||
|
||||
@@ -18,4 +18,4 @@ describe 'ProductsCtrl', ->
|
||||
ctrl = $controller 'ProductsCtrl', {$scope: scope, Product: Product, OrderCycle: OrderCycle}
|
||||
|
||||
it 'fetches products from Product', ->
|
||||
expect(scope.data).toEqual 'testy mctest'
|
||||
expect(scope.products).toEqual 'testy mctest'
|
||||
|
||||
@@ -6,19 +6,19 @@ describe "Hubs service", ->
|
||||
id: 2
|
||||
active: false
|
||||
orders_close_at: new Date()
|
||||
type: "hub"
|
||||
enterprise_type: "hub"
|
||||
}
|
||||
{
|
||||
id: 3
|
||||
active: false
|
||||
orders_close_at: new Date()
|
||||
type: "hub"
|
||||
enterprise_type: "hub"
|
||||
}
|
||||
{
|
||||
id: 1
|
||||
active: true
|
||||
orders_close_at: new Date()
|
||||
type: "hub"
|
||||
enterprise_type: "hub"
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
@@ -16,4 +16,4 @@ describe "Hubs service", ->
|
||||
OfnMap = $injector.get("OfnMap")
|
||||
|
||||
it "builds MapMarkers from enterprises", ->
|
||||
expect(OfnMap.enterprises[0].enterprise).toBe enterprises[0]
|
||||
expect(OfnMap.enterprises[0].id).toBe enterprises[0].id
|
||||
|
||||
@@ -2,7 +2,7 @@ describe "Producers service", ->
|
||||
Producers = null
|
||||
Enterprises = null
|
||||
enterprises = [
|
||||
{type: "producer"}
|
||||
{enterprise_type: "producer"}
|
||||
]
|
||||
|
||||
beforeEach ->
|
||||
|
||||
@@ -11,4 +11,4 @@ describe 'Product service', ->
|
||||
it "Fetches products from the backend on init", ->
|
||||
$httpBackend.expectGET("/shop/products").respond([{test : "cats"}])
|
||||
$httpBackend.flush()
|
||||
expect(Product.data.products[0].test).toEqual "cats"
|
||||
expect(Product.products[0].test).toEqual "cats"
|
||||
|
||||
Reference in New Issue
Block a user