RIAEvangelist / node-dominos-pizza-api

This is a node.js wrapper for the dominos pizza apis
MIT License
538 stars 129 forks source link

Order Tests should all pass #23

Closed RIAEvangelist closed 9 years ago

RIAEvangelist commented 9 years ago

seems the price callback is happening 2 times, see the console.log(123) I added in.

it gets fired twice. too tired to look into why right now. the second time, it is empty.

> pizzapi@0.0.5 test /home/bmiller/git/node-dominos-pizza-api
> mocha

  Address
    ✓ should create Address object from JSON
    ✓ should create Address object from string
    ✓ should return address lines
    ✓ should return only zip code in line2
    ✓ should return city, state, zip in address lines
    ✓ should create Address object from array

  Customer
    ✓ should be created

  Order
    Creation
      ✓ should create Customer
      ✓ should add a pizza
      ✓ should validate order (578ms)
new order: 

123
Price results!: 

123
      1) should price order

  Utilities
    FindStores
      ✓ should find nearby stores that deliver (396ms)
      ✓ should find nearby stores that carryout (384ms)

  12 passing (2s)
  1 failing

  1) Order Creation should price order:
     Uncaught TypeError: Cannot read property 'Order' of undefined
      at test/order_test.js:181:73
      at Request._callback (src/http-json.js:39:17)
      at _stream_readable.js:908:16
RIAEvangelist commented 9 years ago

Also, FYI the store was closed when I ran the test.

madelinecameron commented 9 years ago

Validate and Price were failing because Dominos seems to lock out popular addresses, likely to prevent prank orders.

If you use another address it works fine. I diagnosed this because 0.0.5 (the version PizzaGiver runs on) was still working. So this issue has to do with Dominos locking out certain address.

I will use a less popular but still public address so the tests will pass.

madelinecameron commented 9 years ago

All tests passing and double callback issue fixed in 31aee1cfc2e94a8d8cad2d1414838c539a0a8df8