mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-29 21:17:17 +00:00
Add controller methods to add and remove exchange fees
This commit is contained in:
@@ -22,6 +22,8 @@ describe 'OrderCycle controllers', ->
|
||||
addDistributor: jasmine.createSpy('addDistributor')
|
||||
addCoordinatorFee: jasmine.createSpy('addCoordinatorFee')
|
||||
removeCoordinatorFee: jasmine.createSpy('removeCoordinatorFee')
|
||||
addExchangeFee: jasmine.createSpy('addExchangeFee')
|
||||
removeExchangeFee: jasmine.createSpy('removeExchangeFee')
|
||||
create: jasmine.createSpy('create')
|
||||
Enterprise =
|
||||
index: jasmine.createSpy('index').andReturn('enterprises list')
|
||||
@@ -95,6 +97,16 @@ describe 'OrderCycle controllers', ->
|
||||
expect(event.preventDefault).toHaveBeenCalled()
|
||||
expect(OrderCycle.removeCoordinatorFee).toHaveBeenCalledWith(0)
|
||||
|
||||
it 'Adds exchange fees', ->
|
||||
scope.addExchangeFee(event)
|
||||
expect(event.preventDefault).toHaveBeenCalled()
|
||||
expect(OrderCycle.addExchangeFee).toHaveBeenCalled()
|
||||
|
||||
it 'Removes exchange fees', ->
|
||||
scope.removeExchangeFee(event, 'exchange', 0)
|
||||
expect(event.preventDefault).toHaveBeenCalled()
|
||||
expect(OrderCycle.removeExchangeFee).toHaveBeenCalledWith('exchange', 0)
|
||||
|
||||
it 'Submits the order cycle via OrderCycle create', ->
|
||||
scope.submit()
|
||||
expect(OrderCycle.create).toHaveBeenCalled()
|
||||
@@ -125,6 +137,8 @@ describe 'OrderCycle controllers', ->
|
||||
addDistributor: jasmine.createSpy('addDistributor')
|
||||
addCoordinatorFee: jasmine.createSpy('addCoordinatorFee')
|
||||
removeCoordinatorFee: jasmine.createSpy('removeCoordinatorFee')
|
||||
addExchangeFee: jasmine.createSpy('addExchangeFee')
|
||||
removeExchangeFee: jasmine.createSpy('removeExchangeFee')
|
||||
update: jasmine.createSpy('update')
|
||||
Enterprise =
|
||||
index: jasmine.createSpy('index').andReturn('enterprises list')
|
||||
@@ -197,6 +211,16 @@ describe 'OrderCycle controllers', ->
|
||||
expect(event.preventDefault).toHaveBeenCalled()
|
||||
expect(OrderCycle.removeCoordinatorFee).toHaveBeenCalledWith(0)
|
||||
|
||||
it 'Adds exchange fees', ->
|
||||
scope.addExchangeFee(event)
|
||||
expect(event.preventDefault).toHaveBeenCalled()
|
||||
expect(OrderCycle.addExchangeFee).toHaveBeenCalled()
|
||||
|
||||
it 'Removes exchange fees', ->
|
||||
scope.removeExchangeFee(event, 'exchange', 0)
|
||||
expect(event.preventDefault).toHaveBeenCalled()
|
||||
expect(OrderCycle.removeExchangeFee).toHaveBeenCalledWith('exchange', 0)
|
||||
|
||||
it 'Submits the order cycle via OrderCycle update', ->
|
||||
scope.submit()
|
||||
expect(OrderCycle.update).toHaveBeenCalled()
|
||||
|
||||
Reference in New Issue
Block a user