mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-27 21:06:49 +00:00
Angularising Admin enterprises form
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
describe "enterpriseCtrl", ->
|
||||
ctrl = null
|
||||
scope = null
|
||||
Enterprise = null
|
||||
|
||||
beforeEach ->
|
||||
module('admin.enterprises')
|
||||
Enterprise =
|
||||
enterprise: "test enterprise"
|
||||
|
||||
inject ($controller) ->
|
||||
scope = {}
|
||||
ctrl = $controller 'enterpriseCtrl', {$scope: scope, Enterprise: Enterprise}
|
||||
|
||||
it "stores enterprise", ->
|
||||
expect(scope.enterprise).toBe Enterprise.enterprise
|
||||
@@ -0,0 +1,12 @@
|
||||
describe "Enterprise service", ->
|
||||
Enterprise = null
|
||||
enterprise = { name: "test ent name" }
|
||||
beforeEach ->
|
||||
module 'admin.enterprises'
|
||||
angular.module('admin.enterprises').value('enterprise', enterprise)
|
||||
|
||||
inject ($injector) ->
|
||||
Enterprise = $injector.get("Enterprise")
|
||||
|
||||
it "stores enterprise value as Enterprise.enterprise", ->
|
||||
expect(Enterprise.enterprise).toBe enterprise
|
||||
Reference in New Issue
Block a user