Pass checkout form to controller method

This commit is contained in:
Rohan Mitchell
2014-11-06 14:11:31 +11:00
parent 75b250d3fe
commit cbb968d87f
4 changed files with 7 additions and 11 deletions

View File

@@ -43,16 +43,12 @@ describe "CheckoutCtrl", ->
scope.submitted = false
it "delegates to the service when valid", ->
scope.checkout =
$valid: true
scope.purchase(event)
scope.purchase(event, {$valid: true})
expect(Checkout.submit).toHaveBeenCalled()
expect(scope.submitted).toBe(true)
it "does nothing when invalid", ->
scope.checkout =
$valid: false
scope.purchase(event)
scope.purchase(event, {$valid: false})
expect(Checkout.submit).not.toHaveBeenCalled()
expect(scope.submitted).toBe(true)