Further patches to the damned RABL system, patching everything up to use our new Service structure

This commit is contained in:
Will Marshall
2014-06-18 17:54:13 +10:00
parent 224a70c11f
commit c02c7cf7ca
18 changed files with 40 additions and 37 deletions

View File

@@ -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'

View File

@@ -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"
}
]

View File

@@ -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

View File

@@ -2,7 +2,7 @@ describe "Producers service", ->
Producers = null
Enterprises = null
enterprises = [
{type: "producer"}
{enterprise_type: "producer"}
]
beforeEach ->

View File

@@ -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"