mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-19 00:27:25 +00:00
16 lines
437 B
CoffeeScript
16 lines
437 B
CoffeeScript
describe 'Shop services', ->
|
|
$httpBackend = null
|
|
Product = null
|
|
|
|
beforeEach ->
|
|
module 'Shop'
|
|
inject ($injector, _$httpBackend_)->
|
|
Product = $injector.get("Product")
|
|
$httpBackend = _$httpBackend_
|
|
|
|
it "Fetches products from the backend", ->
|
|
$httpBackend.expectGET("/shop/products").respond([{test : "cats"}])
|
|
products = Product.all()
|
|
$httpBackend.flush()
|
|
expect(products[0].test).toEqual "cats"
|