Admin can view an order cycle in the simple edit form

This commit is contained in:
Rohan Mitchell
2014-10-23 11:08:27 +11:00
parent 56ebe688dc
commit f7c1340f99
5 changed files with 93 additions and 3 deletions

View File

@@ -0,0 +1,38 @@
describe "AdminSimpleEditOrderCycleCtrl", ->
ctrl = null
scope = {}
location = {}
OrderCycle = {}
Enterprise = {}
EnterpriseFee = {}
incoming_exchange = {}
outgoing_exchange = {}
beforeEach ->
scope = {}
location =
absUrl: ->
'example.com/admin/order_cycles/27/edit'
OrderCycle =
order_cycle:
incoming_exchanges: [incoming_exchange]
outgoing_exchanges: [outgoing_exchange]
load: jasmine.createSpy()
Enterprise =
index: jasmine.createSpy()
EnterpriseFee =
index: jasmine.createSpy()
module('admin.order_cycles')
inject ($controller) ->
ctrl = $controller 'AdminSimpleEditOrderCycleCtrl', {$scope: scope, $location: location, OrderCycle: OrderCycle, Enterprise: Enterprise, EnterpriseFee: EnterpriseFee}
describe "initialisation", ->
enterprise = {id: 123}
enterprises = {123: enterprise}
beforeEach ->
scope.init(enterprises)
it "sets the outgoing exchange", ->
expect(scope.outgoing_exchange).toEqual outgoing_exchange