mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-27 21:06:49 +00:00
26 lines
602 B
CoffeeScript
26 lines
602 B
CoffeeScript
describe "CheckoutCtrl", ->
|
|
ctrl = null
|
|
scope = null
|
|
order = null
|
|
|
|
beforeEach ->
|
|
module("Darkswarm")
|
|
order = {
|
|
submit: ->
|
|
navigate: ->
|
|
}
|
|
inject ($controller, $rootScope) ->
|
|
scope = $rootScope.$new()
|
|
ctrl = $controller 'CheckoutCtrl', {$scope: scope, Order: order}
|
|
|
|
it "defaults the user accordion to visible", ->
|
|
expect(scope.accordion.user).toEqual true
|
|
|
|
it "delegates to the service on submit", ->
|
|
event = {
|
|
preventDefault: ->
|
|
}
|
|
spyOn(order, "submit")
|
|
scope.purchase(event)
|
|
expect(order.submit).toHaveBeenCalled()
|