mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-11 03:40:20 +00:00
Switch from old success/error to modern then/catch structure
Catch() will get a few more errors then errors() Also, add try/catch inside catch to detect any errors parsing the response error payload
This commit is contained in:
@@ -119,6 +119,7 @@ describe 'Checkout service', ->
|
||||
it "puts errors into the scope", ->
|
||||
$httpBackend.expectPUT("/checkout.json").respond 400, {errors: {error: "frogs"}}
|
||||
Checkout.submit()
|
||||
|
||||
$httpBackend.flush()
|
||||
expect(Checkout.errors).toEqual {error: "frogs"}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user